diff --git a/doc/api.md b/doc/api.md index deb31a5..c769861 100644 --- a/doc/api.md +++ b/doc/api.md @@ -112,17 +112,17 @@ Emits `message` when a message arrives. | [options.polling.params] | Object | | Parameters to be used in polling API requests. See https://core.telegram.org/bots/api#getupdates for more information. | | [options.polling.params.timeout] | Number | 10 | Timeout in seconds for long polling. | | [options.webHook] | Boolean | Object | false | Set true to enable WebHook or set options | -| [options.webHook.host] | String | 0.0.0.0 | Host to bind to | +| [options.webHook.host] | String | "0.0.0.0" | Host to bind to | | [options.webHook.port] | Number | 8443 | Port to bind to | | [options.webHook.key] | String | | Path to file with PEM private key for webHook server. The file is read **synchronously**! | | [options.webHook.cert] | String | | Path to file with PEM certificate (public) for webHook server. The file is read **synchronously**! | | [options.webHook.pfx] | String | | Path to file with PFX private key and certificate chain for webHook server. The file is read **synchronously**! | | [options.webHook.autoOpen] | Boolean | true | Open webHook immediately | | [options.webHook.https] | Object | | Options to be passed to `https.createServer()`. Note that `options.webHook.key`, `options.webHook.cert` and `options.webHook.pfx`, if provided, will be used to override `key`, `cert` and `pfx` in this object, respectively. See https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener for more information. | -| [options.webHook.healthEndpoint] | String | /healthz | An endpoint for health checks that always responds with 200 OK | +| [options.webHook.healthEndpoint] | String | "/healthz" | An endpoint for health checks that always responds with 200 OK | | [options.onlyFirstMatch] | Boolean | false | Set to true to stop after first match. Otherwise, all regexps are executed | | [options.request] | Object | | Options which will be added for all requests to telegram api. See https://github.com/request/request#requestoptions-callback for more information. | -| [options.baseApiUrl] | String | https://api.telegram.org | API Base URl; useful for proxying and testing | +| [options.baseApiUrl] | String | "https://api.telegram.org" | API Base URl; useful for proxying and testing | | [options.filepath] | Boolean | true | Allow passing file-paths as arguments when sending files, such as photos using `TelegramBot#sendPhoto()`. See [usage information][usage-sending-files-performance] for more information on this option and its consequences. | | [options.badRejection] | Boolean | false | Set to `true` **if and only if** the Node.js version you're using terminates the process on unhandled rejections. This option is only for *forward-compatibility purposes*. | @@ -234,7 +234,11 @@ This method has an [older, compatible signature][setWebHook-v0.25.0] that is being deprecated. **Kind**: instance method of [TelegramBot](#TelegramBot) -**See**: https://core.telegram.org/bots/api#setwebhook +**See** + +- https://core.telegram.org/bots/api#setwebhook +- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files + | Param | Type | Description | | --- | --- | --- | diff --git a/src/telegram.js b/src/telegram.js index 61f885d..e3d1f1b 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -153,7 +153,7 @@ class TelegramBot extends EventEmitter { * See https://core.telegram.org/bots/api#getupdates for more information. * @param {Number} [options.polling.params.timeout=10] Timeout in seconds for long polling. * @param {Boolean|Object} [options.webHook=false] Set true to enable WebHook or set options - * @param {String} [options.webHook.host=0.0.0.0] Host to bind to + * @param {String} [options.webHook.host="0.0.0.0"] Host to bind to * @param {Number} [options.webHook.port=8443] Port to bind to * @param {String} [options.webHook.key] Path to file with PEM private key for webHook server. * The file is read **synchronously**! @@ -166,11 +166,11 @@ class TelegramBot extends EventEmitter { * Note that `options.webHook.key`, `options.webHook.cert` and `options.webHook.pfx`, if provided, will be * used to override `key`, `cert` and `pfx` in this object, respectively. * See https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener for more information. - * @param {String} [options.webHook.healthEndpoint=/healthz] An endpoint for health checks that always responds with 200 OK + * @param {String} [options.webHook.healthEndpoint="/healthz"] An endpoint for health checks that always responds with 200 OK * @param {Boolean} [options.onlyFirstMatch=false] Set to true to stop after first match. Otherwise, all regexps are executed * @param {Object} [options.request] Options which will be added for all requests to telegram api. * See https://github.com/request/request#requestoptions-callback for more information. - * @param {String} [options.baseApiUrl=https://api.telegram.org] API Base URl; useful for proxying and testing + * @param {String} [options.baseApiUrl="https://api.telegram.org"] API Base URl; useful for proxying and testing * @param {Boolean} [options.filepath=true] Allow passing file-paths as arguments when sending files, * such as photos using `TelegramBot#sendPhoto()`. See [usage information][usage-sending-files-performance] * for more information on this option and its consequences. @@ -477,6 +477,7 @@ class TelegramBot extends EventEmitter { * @param {Object} [fileOptions] Optional file related meta-data * @return {Promise} * @see https://core.telegram.org/bots/api#setwebhook + * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files */ setWebHook(url, options = {}, fileOptions = {}) { /* The older method signature was setWebHook(url, cert).