n_cols: int,
header_buttons: list = None,
footer_buttons: list = None):
menu = [buttons[i:i + n_cols] for i in range(0, len(buttons), n_cols)]
return menu
some_strings = ["col1", "col2", "row2"]
button_list = [types.InlineKeyboardButton(s) for s in some_strings]
keyboard = telebot.types.InlineKeyboardMarkup(build_menu(button_list, n_cols=2))
print(button_list)
print(keyboard)
bot.send_message(message.from_user.id, "Клава?", reply_markup=keyboard)
Обсуждают сегодня