问题
I created a Telegram Bot and setwebhook to a ssl url. My developing language is Php. In testing time, every thing worked fine but after many hours and two or three users have been registered, I got bellow error on getWebhookInfo
{"ok":true,"result":{"url":"https://xx.com/get-text","has_custom_certificate":false,"pending_update_count":111,"last_error_date":1501993548,"last_error_message":"Read timeout expired","max_connections":40}}
I found that pending_update_count could not be cleared. After that I returned 200 status to Telegram , delete webhook , set GetUpdate and again set webhook But nothing changed.Again I have 111 pending update count.
On the other side, I and three other users give last response every two minutes. I Delete bot and again /start it but such as before, I give last response every two minutes.
How can I solve this problem ??
Thanks all
回答1:
It's so crazy and simple! I faced with it, too. If you're putting 200 or 1 as the status, just replace it with 'ok' with lowercase! just it.
PS: You may used Laravel package like irazasyed. If yes, I'm sure about the answer. Because they wrote it with 200 instead of lowercase 'ok'!
来源:https://stackoverflow.com/questions/45528857/clear-pending-update-count-in-telegram-bot