Exemplo n.º 1
0
        private async Task OnAgeAnswer(Message message)
        {
            userData.Age = Int32.Parse(message.Text);

            var otdels  = OtdelsTable.GetAllOtdels();
            var buttons = new InlineKeyboardButton[otdels.Length][];

            for (int i = 0; i < buttons.GetLength(0); i++)
            {
                buttons[i]    = new InlineKeyboardButton[1];
                buttons[i][0] = InlineKeyboardButton.WithCallbackData(otdels[i].Name, otdels[i].ID.ToString());
            }

            var inlineKeyboard = new InlineKeyboardMarkup(buttons);

            await Bot.SendTextMessageAsync(
                chatId : message.Chat.Id,
                text : "Выберите отдел",
                replyMarkup : inlineKeyboard
                );

            onGetAnswer   = OnOtdelAnswer;
            onQueryAnswer = OnOtdelQueryReceived;
        }