Meglio
Meglio

Reputation: 1735

Telegram Bot API getUpdates() does not deliver updates after user have not interacted with the bot for a few days

As a telegram bot api developer, I noticed a weird behaviour of the getUpdates() api method:

If the user have not interacted with the bot for a few days, then the next time it sends a message to the bot, the message does not get delivered via the long-poll.

The workaround is to "cleanup the chat" - then all of a sudden the messages get delivered again. But this workaround is ugly.

What can be the cause of this issue, and is there any "lighter" workaround that will not touch the chat history?

Upvotes: 2

Views: 1515

Answers (1)

Nemo I'm
Nemo I'm

Reputation: 7

Try to use getWebhookUpdates()
According to documentation

Blockquote There are two mutually exclusive ways of receiving updates for your bot — the getUpdates method on one hand and Webhooks on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.

https://telegram-bot-sdk.readme.io/docs/webhook-updates

Upvotes: -1

Related Questions