2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 18:07:16 +00:00

Updated README

This commit is contained in:
Yago 2016-01-30 18:19:39 +01:00
parent 41be1afb9c
commit 1b1e8c7bec

View File

@ -76,7 +76,7 @@ TelegramBot
* [.getFileLink(fileId)](#TelegramBot+getFileLink) ⇒ <code>Promise</code> * [.getFileLink(fileId)](#TelegramBot+getFileLink) ⇒ <code>Promise</code>
* [.downloadFile(fileId, downloadDir)](#TelegramBot+downloadFile) ⇒ <code>Promise</code> * [.downloadFile(fileId, downloadDir)](#TelegramBot+downloadFile) ⇒ <code>Promise</code>
* [.onText(regexp, callback)](#TelegramBot+onText) * [.onText(regexp, callback)](#TelegramBot+onText)
* [.onReplyToMessage(messageId, callback)](#TelegramBot+onReplyToMessage) * [.onReplyToMessage(chatId, messageId, callback)](#TelegramBot+onReplyToMessage)
<a name="new_TelegramBot_new"></a> <a name="new_TelegramBot_new"></a>
### new TelegramBot(token, [options]) ### new TelegramBot(token, [options])
@ -90,7 +90,7 @@ Emits `message` when a message arrives.
| token | <code>String</code> | | Bot Token | | token | <code>String</code> | | Bot Token |
| [options] | <code>Object</code> | | | | [options] | <code>Object</code> | | |
| [options.polling] | <code>Boolean</code> &#124; <code>Object</code> | <code>false</code> | Set true to enable polling or set options | | [options.polling] | <code>Boolean</code> &#124; <code>Object</code> | <code>false</code> | Set true to enable polling or set options |
| [options.polling.timeout] | <code>String</code> &#124; <code>Number</code> | <code>4</code> | Polling time | | [options.polling.timeout] | <code>String</code> &#124; <code>Number</code> | <code>10</code> | Polling time in seconds |
| [options.polling.interval] | <code>String</code> &#124; <code>Number</code> | <code>2000</code> | Interval between requests in miliseconds | | [options.polling.interval] | <code>String</code> &#124; <code>Number</code> | <code>2000</code> | Interval between requests in miliseconds |
| [options.webHook] | <code>Boolean</code> &#124; <code>Object</code> | <code>false</code> | Set true to enable WebHook or set options | | [options.webHook] | <code>Boolean</code> &#124; <code>Object</code> | <code>false</code> | Set true to enable WebHook or set options |
| [options.webHook.key] | <code>String</code> | | PEM private key to webHook server. | | [options.webHook.key] | <code>String</code> | | PEM private key to webHook server. |
@ -343,14 +343,15 @@ Register a RegExp to test against an incomming text message.
| callback | <code>function</code> | Callback will be called with 2 parameters, the `msg` and the result of executing `regexp.exec` on message text. | | callback | <code>function</code> | Callback will be called with 2 parameters, the `msg` and the result of executing `regexp.exec` on message text. |
<a name="TelegramBot+onReplyToMessage"></a> <a name="TelegramBot+onReplyToMessage"></a>
### telegramBot.onReplyToMessage(messageId, callback) ### telegramBot.onReplyToMessage(chatId, messageId, callback)
Register a reply to wait for a message response. Register a reply to wait for a message response.
**Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code> **Kind**: instance method of <code>[TelegramBot](#TelegramBot)</code>
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| messageId | <code>Number</code> &#124; <code>String</code> | The ID of the message to be replied | | chatId | <code>Number</code> &#124; <code>String</code> | The chat id where the message cames from. |
| messageId | <code>Number</code> &#124; <code>String</code> | The message id to be replied. |
| callback | <code>function</code> | Callback will be called with the reply message. | | callback | <code>function</code> | Callback will be called with the reply message. |
* * * * * *