yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.12k stars 1.49k forks source link

Webhook setup via URL returns blank #1191

Open azickri opened 2 months ago

azickri commented 2 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