How can I make a bot to pretend that it is typing a message?
The following text appears in the chat when the bot pretend to type:
I use the python aiogram framework but a suggestion for the native Telegram API would be also helpful.
How can I make a bot to pretend that it is typing a message?
The following text appears in the chat when the bot pretend to type:
I use the python aiogram framework but a suggestion for the native Telegram API would be also helpful.
2
Answers
I seriously suggest using the
python-telegram-bot
library which has an extensive Wiki. The solution for what you want is described in code snippets.You can manually send the action:
Or create a decorator which can then be used on any function you wish to show that action on whilst processing:
For aiogram module you can use types.Message built in method
answer_chat_action
.Here is another action types such as upload_photo, record_video_note and so on. And here is aiogram documentation.