M
M
MMAI2021-02-15 20:30:48
Python
MMAI, 2021-02-15 20:30:48

How to add a command to the telegram bot button?

The essence of the question is as follows, there is a /go command and there is a button to make a deal. How to combine a command and a button so that when clicked, the /go command is executed.

@bot.message_handler(commands=['go'])
def menu(message):

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-02-15
@SoreMix

Make your own decorator

@bot.message_handler(func = lambda m: m.text in ['/go', 'Текст на кнопке'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question