Alireza Mohamadi
Alireza Mohamadi

Reputation: 521

Telegram update consuming

I'm new to Telegram Bots API so I'm still at abstraction phase.
Anyway I'm testing some Telegram methods using Postman. When I send a getUpdates request to server, it sends me all the updates, but the problem is if I send getUpdates again, I receive previous updates, too.
So is there any way to consume incoming updates so that server doesn't send them again?
Telegram Bots API is very compact and lacks good explanations. That's why I'm asking here.

Upvotes: 1

Views: 494

Answers (1)

Alireza Mohamadi
Alireza Mohamadi

Reputation: 521

Quote from Telegram's Bots FAQ:

The getUpdates method returns the earliest 100 unconfirmed updates. To confirm an update, use the offset parameter when calling getUpdates like this:

offset = update_id of last processed update + 1

All updates with update_id less than or equal to offset will be marked as confirmed on the server and will no longer be returned.

Upvotes: 4

Related Questions