A
A
akulonful2018-05-24 00:13:23
Python
akulonful, 2018-05-24 00:13:23

How to arrange the buttons correctly?

How to arrange 4 buttons 2 by two?

def get_keyboard():
    keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True)
    keyboard.add(*[types.KeyboardButton(name) for name in ['Стратегия 1.0            ', 'Стратегия 2.0            ', 'Инструкция', 'Поддержка']])
    return keyboard

3 are displayed in the first line and one big one at the bottom.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Restwl, 2018-05-31
@Restwl

In the telegram bot api, the buttons are sent in a 2D array. In order to divide the buttons into two rows, you need to place them in the form:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question