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)); } } } }
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); } }
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)); }
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)); }