J
J
Jairman2020-04-29 18:10:46
Python
Jairman, 2020-04-29 18:10:46

How to restart the message tree when restarting the telegram bot?

With certain clicks on the buttons, the user fills in the table (about 5 actions). Let's say the user on the 3rd message deletes the chat or clears the history. How, in this case, to start all over again, as if it were a new person, because in this way he will continue from the step where he stopped

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseniy Kulikov, 2020-04-29
@klkvr

You can assign your own state to each user (I usually do this through redis) and make a script that replaces all state with the initial value. And if your bot restarts via cron, then add a reset script to run before it starts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question