2
0
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:
GochoMugo
2017-01-11 17:06:04 +03:00
parent 061d11a109
commit a9d6e93622
3 changed files with 22 additions and 0 deletions

View File

@@ -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>