清除Telegram Bot中的未决更新数 [英] clear pending_update_count in Telegram Bot

查看:152
本文介绍了清除Telegram Bot中的未决更新数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Telegram Bot并将setwebhook设置为ssl url.我的开发语言是PHP. 在测试期间,一切正常,但是在注册了两个小时或多个小时之后,我在getWebhookInfo上遇到了以下错误

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}}

我发现无法清除ending_update_count. 之后,我将200状态恢复为Telegram,删除webhook,设置GetUpdate并再次设置webhook但什么都没改变.同样我有111个待处理的更新计数.

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.

另一方面,我和其他三个用户每两分钟给出一次最后响应.我删除了bot并再次/启动它,但是像以前一样,我每两分钟给出最后一个响应.

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 ??

谢谢

推荐答案

它是如此的疯狂和简单!我也面对它. 如果您将200或1设置为状态,只需用小写的'ok'替换即可!就是这样.

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: 您可以使用irazasyed之类的Laravel软件包.如果是,我确定答案.因为他们用200而不是小写的"ok"写了它!

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'!

这篇关于清除Telegram Bot中的未决更新数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆