How I would like to do: the action is dispatched, how it ends file is sent. But it turns out that the action lasts 5 seconds, and then it takes another 5 seconds to send the file, and this time the user does not understand whether the bot is frozen or the file is still being sent. How can I increase the duration of action before sending the file directly?
import telebot
...
def send_file(m: Message, file):
bot.send_chat_action(m.chat.id, action='upload_document')
bot.send_document(m.chat.id, file)
As Tibebes. M said this is not possible because all actions are sent via API. But threads helped me to solve the problem. The solution looks like this:
Thus, it is possible to make it so that as soon as the action ends, the file is immediately sent without time gaps