mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-31 06:16:07 +00:00
src/polling: Add options to TelegramBot#stopPolling()
Feature: * Simply, pass through options to TelegramBot#stopPolling(options) to TelegramBotPolling#stop(options) References: * Related PR: https://github.com/yagop/node-telegram-bot-api/pull/456
This commit is contained in:
11
doc/api.md
11
doc/api.md
@@ -16,7 +16,7 @@ TelegramBot
|
||||
* [.on(event, listener)](#TelegramBot+on)
|
||||
* [.startPolling([options])](#TelegramBot+startPolling) ⇒ <code>Promise</code>
|
||||
* ~~[.initPolling([options])](#TelegramBot+initPolling) ⇒ <code>Promise</code>~~
|
||||
* [.stopPolling()](#TelegramBot+stopPolling) ⇒ <code>Promise</code>
|
||||
* [.stopPolling([options])](#TelegramBot+stopPolling) ⇒ <code>Promise</code>
|
||||
* [.isPolling()](#TelegramBot+isPolling) ⇒ <code>Boolean</code>
|
||||
* [.openWebHook()](#TelegramBot+openWebHook) ⇒ <code>Promise</code>
|
||||
* [.closeWebHook()](#TelegramBot+closeWebHook) ⇒ <code>Promise</code>
|
||||
@@ -169,12 +169,19 @@ Alias of `TelegramBot#startPolling()`. This is **deprecated**.
|
||||
|
||||
<a name="TelegramBot+stopPolling"></a>
|
||||
|
||||
### telegramBot.stopPolling() ⇒ <code>Promise</code>
|
||||
### telegramBot.stopPolling([options]) ⇒ <code>Promise</code>
|
||||
Stops polling after the last polling request resolves.
|
||||
Multiple invocations do nothing if polling is already stopped.
|
||||
Returning the promise of the last polling request is **deprecated**.
|
||||
|
||||
**Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code>
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [options] | <code>Object</code> | Options |
|
||||
| [options.cancel] | <code>Boolean</code> | Cancel current request |
|
||||
| [options.reason] | <code>String</code> | Reason for stopping polling |
|
||||
|
||||
<a name="TelegramBot+isPolling"></a>
|
||||
|
||||
### telegramBot.isPolling() ⇒ <code>Boolean</code>
|
||||
|
Reference in New Issue
Block a user