Ejemplo n.º 1
0
        public static IReplyMarkup ToReplyMarkup(this ButtonLayout layout)
        {
            ButtonInfo[][]     buttons         = layout.GetButtons();
            KeyboardButton[][] keyboardButtons = new KeyboardButton[buttons.Length][];

            for (int i = 0; i < buttons.Length; i++)
            {
                keyboardButtons[i] = new KeyboardButton[buttons[i].Length];

                for (int j = 0; j < buttons[i].Length; j++)
                {
                    keyboardButtons[i][j] = buttons[i][j].ToTelegramButton();
                }
            }

            return(new ReplyKeyboardMarkup(keyboardButtons, layout.OneTimeKeyboard, layout.ResizeKeyboard));
        }