Clear “pending_update_count” in Telegram Bot

后端 未结 5 1764
渐次进展
渐次进展 2021-01-04 05:44

I want to clear all pending_update_count in my bot!

The output of below command :

https://api.telegram.org/botxxxxxxxxxxxxxxxx/getWebhoo         


        
5条回答
  •  借酒劲吻你
    2021-01-04 06:04

    I think you have two options:

    1. set webhook that do nothing, just say 200 OK to telegram's servers. Telegram wiil send all updates to this url and the queque will be cleared.
    2. disable webhook and after it get updates by using getUpdates method, after it, turn on webhook again

    Update:

    Problem with webhook on your side. You can try to emulate telegram's POST query on your URL. It can be something like this:

    {"message_id":1,"from":{"id":1,"first_name":"FirstName","last_name":"LastName","username":"username"},"chat":{"id":1,"first_name":"FirstName","last_name":"LastName","username":"username","type":"private"},"date":1460957457,"text":"test message"}
    

    You can send this text as a POST query body with PostMan for example, and after it try to debug your backend.

提交回复
热议问题