Answer the question
In order to leave comments, you need to log in
What should be the logic of the telegram bot?
I am writing a telegram bot, in which there is a chain of questions to the user. As a result, it should turn out so that it would be possible to process several users at the same time. To do this, I decided to store data about the current state of the user in the database, i.e. at what stage it is now, so that it would be possible to continue at any time, even if the user paused. When a new message from the user enters the chat, a request is made to the database about the current state. The state is stored as an integer from 0 to 3. Next, the condition is checked, and depending on which digit the corresponding polling stage is performed.
It looks like this:
if int(condition) == 1:
bot.register_next_step_handler(message, get_data2)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question