1
votes

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
@SaeidTahmuresi Thanks Saeid But I did all that tasks, After that created this question - hrzrahimi
What kind of host do you use? Free? Paid? VPS? - Saeid Tahmuresi
hosting panel with cpanel. For ssl I used cloudflare. I used cloudflare for other bots and they are working well - hrzrahimi
It seems that there are some problem on your code. Some think that make infinite loop (or other endless process). Check "Number of Processes" on your hosting cPanel compare it with "pending_update_count". - Saeid Tahmuresi

1 Answers

0
votes

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