mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-31 06:16:07 +00:00
[telegram] Return error on trying to use Polling, WebHook together
Feature: Polling and WebHook are mutually exclusive. Therefore, return an error whenever the user tries to start polling, and the instance has an open webhook, or user tries to open a webhook, and the instance is already polling.
This commit is contained in:
@@ -150,6 +150,7 @@ Emits `message` when a message arrives.
|
||||
|
||||
### telegramBot.startPolling([options]) ⇒ <code>Promise</code>
|
||||
Start polling.
|
||||
Rejects returned promise if a WebHook is being used by this instance.
|
||||
|
||||
**Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code>
|
||||
|
||||
@@ -190,6 +191,7 @@ Return true if polling. Otherwise, false.
|
||||
### telegramBot.openWebHook() ⇒ <code>Promise</code>
|
||||
Open webhook.
|
||||
Multiple invocations do nothing if webhook is already open.
|
||||
Rejects returned promise if Polling is being used by this instance.
|
||||
|
||||
**Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code>
|
||||
<a name="TelegramBot+closeWebHook"></a>
|
||||
|
Reference in New Issue
Block a user