Esempio n. 1
0
        public static InlineKeyboardButton[][] GetInlineKeyboard(int column, int row, List <DynamicButtons> stringArray)
        {
            var keyboardInline  = new InlineKeyboardButton[row][];
            var keyboardButtons = new InlineKeyboardButton[stringArray.Count];

            for (var i = 0; i < stringArray.Count; i++)
            {
                keyboardButtons[i] = InlineKeyboardButton.WithCallbackData(stringArray[i].Text, stringArray[i].Command);
            }
            for (int i = 0; i < row; i++)
            {
                keyboardInline[i] = keyboardButtons.Skip(i * column).Take(column).ToArray();
            }
            return(keyboardInline);
        }