I am working with pyTelegramBotAPI, and I was checking the deleteMessage method, and it says you have 48 hours ( in a group / channel ) for delete a message, but, I don’t find the way to put the timer, ¿can somebody help?
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
2
Answers
If by "timer" you mean an attribute that may specify when to delete the message, you will hardly find it there.
What the documentation means by
is that once you send the message, after you send a message, you have 48 hours to use this endpoint to delete the request.
If you want to delete it after some time, you need to implement some kind of scheduling in you application (probably the one that sends the messages)
For that you might want to use Python’s sched or schedule or something more advance like Celery Beat.
You must remember the chat and the message id and delete it later by calling the method. Delayed deletion is not implemented in telegram API.
As an option, write a separate daemon that will perform certain actions at a certain time