A
A
Andriy4262021-09-11 19:42:38
Python
Andriy426, 2021-09-11 19:42:38

bot.register_next_step_handler not working how to fix?

@bot.message_handler(commands=['go'])
def mess1(message):
    bot.send_message(message.chat.id, "Привет!")
    print("ГОТОВО")
    bot.register_next_step_handler(message, mess2)

def mess2(message):
    bot.send_message(message.chat.id, "как дела?")
    print("ГОТОВО")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-09-12
@SoreMix

See the usage example
https://github.com/eternnoir/pyTelegramBotAPI/blob...
The first argument is the new message you sent

@bot.message_handler(commands=['go'])
def mess1(message):
    msg = bot.send_message(message.chat.id, "Привет!")
    print("ГОТОВО")
    bot.register_next_step_handler(msg, mess2)

def mess2(message):
    bot.send_message(message.chat.id, "как дела?")
    print("ГОТОВО")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question