How to ignore old messages sent when the bot was offline #304
-
Hi,
And someone spammed Hi in the group chat while the bot was offline, how can I make the bot ignore all the messages that was sent when it was offline? Knowing that there's no database to store when it came back alive. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I guess, it's not a question to the library. It's up to your application (bot), business logic. Commonly, you can process these messages and response as regular (but with delay). But… to ignore them — you have to keep some marker in application, like a start time, and compare incoming messages time with it, for example. As I know, Telegram will forget about these pending messages after some time, maybe around 1 hour, or 24 hours. |
Beta Was this translation helpful? Give feedback.
I guess, it's not a question to the library. It's up to your application (bot), business logic.
Commonly, you can process these messages and response as regular (but with delay).
But… to ignore them — you have to keep some marker in application, like a start time, and compare incoming messages time with it, for example.
As I know, Telegram will forget about these pending messages after some time, maybe around 1 hour, or 24 hours.