Exemple #1
0
        private async Task SetParameterValueFromClient(MethodInfo methodInfo, ParameterInfo parameterInfo, TelegramClientInfo clientInfo, MessageEventArgs e)
        {
            string value = e.Message.Text;

            clientInfo.CurrentParameterName = null;
            List <List <BotButtonInfo> > buttons = GetMethodParametersButtons(methodInfo, clientInfo);

            CurrentBotStructureInfo.OnButtonsGenerating(buttons, BotLevelType.Parameters, clientInfo.CurrentServiceName, clientInfo.CurrentMethodName, clientInfo);
            ReplyKeyboardMarkup replyMarkup = new ReplyKeyboardMarkup
            {
                Keyboard = BotButtonsToKeyboardButtons(buttons, clientInfo)
            };

            ChangeParameterValue(methodInfo, parameterInfo, clientInfo, value);
            await _botClient.SendTextMessageAsync(
                chatId : e.Message.Chat,
                text : CurrentBotStructureInfo.GetParameterValueChangedText(GetParameterCaption(methodInfo, parameterInfo), clientInfo),
                replyMarkup : replyMarkup
                );
        }