コード例 #1
0
        public static void GetLang(CallbackQuery query, string[] args)
        {
            var temp = args[1].Split('|');

            if (temp.Length == 1)
            {
                if (temp[0] == "cancel")
                {
                    Bot.Edit(query.Message.Chat.Id, query.Message.MessageId, GetTranslation("ConfigDone", GetLanguage(query.Message.Chat.Id)));
                }
            }
            if (temp.Length > 1)
            {
                if (temp[0] == "get")
                {
                    Bot.Edit(query.Message.Chat.Id, query.Message.MessageId, GetTranslation("ConfigDone", GetLanguage(query.Message.Chat.Id), temp[1]));
                    var lang = temp[1] + ".xml";
                    using (var sr = new StreamReader(Path.Combine(Constants.GetLangDirectory(), lang)))
                    {
                        // var file = new FileToSend(lang, sr.BaseStream);
                        BotMethods.SendDocument(query.Message.Chat.Id, new InputOnlineFile(sr.BaseStream, lang));
                    }
                }
            }
        }
コード例 #2
0
ファイル: Bot.cs プロジェクト: kenyim729/SixNimmtBot
 internal static Message Edit(long chatId, int oldMessageId, string text, IReplyMarkup replyMarkup = null, ParseMode parseMode = ParseMode.Html, bool disableWebPagePreview = true, bool disableNotification = false)
 {
     try
     {
         return(BotMethods.Edit(chatId, oldMessageId, text, replyMarkup, parseMode, disableWebPagePreview, disableNotification));
     }
     catch (Exception ex)
     {
         ex.LogError();
         return(null);
     }
 }
コード例 #3
0
ファイル: Bot.cs プロジェクト: kenyim729/SixNimmtBot
 internal static Message SendSticker(long chatId, FileToSend sticker, IReplyMarkup replyMarkup = null, ParseMode parseMode = ParseMode.Html, bool disableWebPagePreview = true, bool disableNotification = false)
 {
     return(BotMethods.SendSticker(chatId, sticker, replyMarkup, disableNotification));
 }
コード例 #4
0
ファイル: Bot.cs プロジェクト: kenyim729/SixNimmtBot
 internal static Message Send(long chatId, string text, IReplyMarkup replyMarkup = null, ParseMode parseMode = ParseMode.Html, bool disableWebPagePreview = true, bool disableNotification = false)
 {
     return(BotMethods.Send(chatId, text, replyMarkup, parseMode, disableWebPagePreview, disableNotification));
 }