示例#1
0
 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);
     }
 }
示例#2
0
        public static void StartGame(Message msg, string[] args)
        {
            Avalon game = Bot.Gm.GetGameByChatId(msg.Chat.Id);

            if (game == null)
            {
                if (Program.MaintMode)
                {
                    Bot.Send(msg.Chat.Id, GetTranslation("CantStartGameMaintenance", GetLanguage(msg.Chat.Id)));
                    return;
                }

                var botIsAdmin = BotMethods.IsBotAdmin(msg.Chat.Id);
                Bot.Gm.AddGame(new Avalon(msg.Chat.Id, msg.From, msg.Chat.Title, botIsAdmin));
            }
            else
            {
                Bot.Gm.HandleMessage(msg);
                // msg.Reply(GetTranslation("ExistingGame", GetLanguage(msg.Chat.Id)));
            }
        }
示例#3
0
 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));
 }