Search code examples
phpnginxtelegram

telegram server can`t update my bot webhook


We have a telegram bot that use a Web-hook to receive updates. It was fine for like 6 months . after some issue with mod_security blocking our site , the Web-hook stopped working and give us " Connection timed out " in the method " getWebhookInfo " . we ask our hosting to white-list our site for mod_security and they did . we can work with our site and everything is fine again but the web-hook keep getting us " Connection timed out ".its like server cached our site and wontt check it again .

we set our web-hook again with new certificate to make sure everything works fine .

message from api.telegram.org/bot<token>/getWebhookInfo is :

{"ok":true,"result":{"url":"https://*****/get","has_custom_certificate":true,"pending_update_count":12,"last_error_date":1495875185,"last_error_message":"Connection timed out","max_connections":40}}

i check the address https://*****/get with postman , send some fake data and its working fine .


Solution

  • This problem is caused by the Telegram bot API

    To solve this problem, I went through the following steps:

    • Revoke token and setWebhook with new token
    • Change url: Change the address where the webhook is sent (change file name or route)
    • Wait a bit

    If the problem is not solved, change the token again and wait a bit more...