P
P
pecenuska21352021-08-20 13:21:49
Python
pecenuska2135, 2021-08-20 13:21:49

How to remap telebot buttons?

markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
                key1 = types.KeyboardButton("Готово")
                key2 = types.KeyboardButton("Отмена")
                markup.add(key1, key2)

This is done after if'a, before that there are the same buttons with different values. But the keyboard after this code does not change.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denys Plakhtii, 2021-08-20
@pecenuska2135

Most likely you need this:

markup = types.ReplyKeyboardMarkup(resize_keyboard=True)

if x == 1:
    markup.add(types.KeyboardButton("Готово"))
else:
    markup.add(types.KeyboardButton("Отмена"))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question