Exemplo n.º 1
0
 public async void ShowServices(TelegramClientInfo clientInfo, List <List <BotButtonInfo> > inlineButtonInfos, string message = null)
 {
     try
     {
         clientInfo.CurrentServiceName = null;
         InlineKeyboardMarkup replyMarkup = new InlineKeyboardMarkup(BotButtonsToKeyboardButtons(inlineButtonInfos));
         await _botClient.SendTextMessageAsync(
             chatId : clientInfo.Message.Chat,
             text : message == null?CurrentBotStructureInfo.GetServicesGeneratedText(clientInfo) : message,
             replyMarkup : replyMarkup
             );
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
Exemplo n.º 2
0
        private async Task ShowServices(TelegramClientInfo clientInfo, MessageEventArgs e)
        {
            string text = CurrentBotStructureInfo.GetServicesGeneratedText(clientInfo);

            clientInfo.CurrentServiceName = null;
            List <List <BotButtonInfo> > buttons = GetListOfServicesButtons(clientInfo);

            CurrentBotStructureInfo.OnButtonsGenerating(buttons, BotLevelType.Services, null, null, clientInfo);
            ReplyKeyboardMarkup replyMarkup = new ReplyKeyboardMarkup
            {
                Keyboard = BotButtonsToKeyboardButtons(buttons, clientInfo)
            };
            await _botClient.SendTextMessageAsync(
                chatId : e.Message.Chat,
                text : text,
                replyMarkup : replyMarkup
                );
        }
Exemplo n.º 3
0
 public async void ShowServices(TelegramClientInfo clientInfo, string message = null)
 {
     try
     {
         clientInfo.CurrentServiceName = null;
         List <List <BotButtonInfo> > buttons = GetListOfServicesButtons(clientInfo);
         CurrentBotStructureInfo.OnButtonsGenerating(buttons, BotLevelType.Services, null, null, clientInfo);
         ReplyKeyboardMarkup replyMarkup = new ReplyKeyboardMarkup
         {
             Keyboard = BotButtonsToKeyboardButtons(buttons, clientInfo)
         };
         await _botClient.SendTextMessageAsync(
             chatId : clientInfo.Message.Chat,
             text : message == null?CurrentBotStructureInfo.GetServicesGeneratedText(clientInfo) : message,
             replyMarkup : replyMarkup
             );
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }