コード例 #1
0
 private async Task ShowServiceMethods(string serviceName, TelegramClientInfo clientInfo, Message message)
 {
     clientInfo.CurrentServiceName = serviceName;
     clientInfo.CurrentMethodName  = null;
     if (Services.TryGetValue(serviceName, out Type service))
     {
         List <List <BotButtonInfo> > buttons = GetServiceMethodsButtons(service, clientInfo);
         CurrentBotStructureInfo.OnButtonsGenerating(buttons, BotLevelType.Services, serviceName, null, clientInfo);
         ReplyKeyboardMarkup replyMarkup = new ReplyKeyboardMarkup
         {
             Keyboard = BotButtonsToKeyboardButtons(buttons, clientInfo)
         };
         await _botClient.SendTextMessageAsync(
             chatId : message.Chat,
             text : CurrentBotStructureInfo.GetServiceSelectedText(GetServiceName(service), GetServiceCaption(service), service, clientInfo),
             replyMarkup : replyMarkup
             );
     }
     else
     {
         await _botClient.SendTextMessageAsync(
             chatId : message.Chat,
             text : CurrentBotStructureInfo.GetServiceNotFoundText(serviceName, clientInfo)
             );
     }
 }