clear pending_update_count in Telegram Bot

寵の児 提交于 2019-12-12 04:04:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!