L
L
Lyokha2019-10-09 18:58:49
Django
Lyokha, 2019-10-09 18:58:49

How to implement a Django timer for a quiz in a telegram bot?

Hello dear programmers!
I am making a quiz in telegram bot with Django.
The bottom line is that you need to issue a question with answers to the user for a certain time, and after the end of the time, the next question is given to him, but if the user answered the question on time, then the timer is updated and another one is given to him.
I have only thought in my head to use Celery.
Namely, after executing the function of sending a question, create a task that, after a certain time, will perform this function again, and if the user has met this period of time and answered, then stop the task and do everything over again.
I'm no expert, but it seems to me that creating a "task" for each question is not the right solution.
How to implement such a thing?
Please enlighten me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2019-10-09
@EdFonse

Quite normal

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question