K
K
Kr1stian2021-07-02 21:59:24
Python
Kr1stian, 2021-07-02 21:59:24

How to resize buttons in python-telegram-bot?

Tell me how you can adjust the size of the buttons or the number of them in a row?

reply_markup = ReplyKeyboardMarkup(
        keyboard=[
            [
            KeyboardButton(text=view),
            KeyboardButton(text=usd),
            KeyboardButton(text=analytics),
            KeyboardButton(text=payment)
            ],
        ],
        resize_keyboard=True,
    )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2021-07-02
@Kr1stian

Your keyboard parameter is a list of rows of buttons. Each row is also a list. Make a two row list

keyboard=[
            [
                KeyboardButton(text=view),
                KeyboardButton(text=usd)
            ],
            [
                KeyboardButton(text=analytics),
                KeyboardButton(text=payment)
            ],
        ]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question