yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.48k stars 1.54k forks source link

Webhook setup via URL returns blank #1191

Open azickri opened 7 months ago

azickri commented 7 months ago

Bug Report

I have read:

I am using the latest version of the library.

Expected Behavior

I want to setup Webhook URLs directly using the API

Actual Behavior

I have tried to set Webhook via Telegram API directly with API as follows

https://api.telegram.org/{token}/setWebhook?url={webhookURL}

When I retrieve information about the Webhook with the API as follows

https://api.telegram.org/{token}/getWebhookInfo

The first time you retrieve information quickly after setting it up it matches the webhookURL you set, after a few seconds it returns to blank.

{
   "ok": true,
   "result": {
     "url": "",
     "has_custom_certificate": false,
     "pending_update_count": 0
   }
}

Steps to reproduce the Behavior

  1. Create a BOT Token
  2. Integrate BOT with this Package
  3. Set Webhook URL using API https://api.telegram.org/{token}/setWebhook?url={webhookURL}
  4. Retrieve Webhook related Information using API https://api.telegram.org/{token}/getWebhookInfo
brendancjz commented 4 days ago

I am facing this exact same issue too. I am able to setWebhook and I can see the url from getWebhookInfo. But after a short while, calling this getWebhookInfo will return an empty string in url. Please advise.