A
A
alekssamos2021-05-30 08:00:21
Kali
alekssamos, 2021-05-30 08:00:21

How to find out that the request is in the queue, at what place and should I wait?

Hello. In some of the TG bots for working with sound or downloading videos from Youtube,
I saw such a thing.
You send him a message, if the bot is free, he immediately proceeds to the desired action, and if not, he writes: "Your request is in the queue. Please wait. You are in 2nd place." Then "You are in 1st place" and after that completes the task.

How to do something similar for yourself?
Here is the task I started:

dv = download_video.delay(chat_id, message_id, url)

And what can I get out of it? state? PENDING / SUCCESS / FAILURE? id? ready() True/False? What else? How to know if execution has started or not, if not, how long to wait?

Of course, I can send the message "Wait, request accepted" before starting the function, and edit or delete it in the function itself, but how is it done in other bots? In the same place, the waiting message is simply not sent.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question