mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-29 13:27:44 +00:00
src: Minor fixes
This commit is contained in:
parent
e75d51ca8f
commit
9a9dfa9560
@ -75,6 +75,7 @@ Emits `message` when a message arrives.
|
||||
| [options.polling.interval] | <code>String</code> | <code>Number</code> | <code>300</code> | Interval between requests in miliseconds |
|
||||
| [options.polling.autoStart] | <code>Boolean</code> | <code>true</code> | Start polling immediately |
|
||||
| [options.polling.params] | <code>Object</code> | | Parameters to be used in polling API requests. See https://core.telegram.org/bots/api#getupdates for more information. |
|
||||
| [options.polling.params.timeout] | <code>Number</code> | <code>10</code> | Timeout in seconds for long polling. |
|
||||
| [options.webHook] | <code>Boolean</code> | <code>Object</code> | <code>false</code> | Set true to enable WebHook or set options |
|
||||
| [options.webHook.host] | <code>String</code> | <code>0.0.0.0</code> | Host to bind to |
|
||||
| [options.webHook.port] | <code>Number</code> | <code>8443</code> | Port to bind to |
|
||||
|
@ -57,6 +57,7 @@ class TelegramBot extends EventEmitter {
|
||||
* @param {Boolean} [options.polling.autoStart=true] Start polling immediately
|
||||
* @param {Object} [options.polling.params] Parameters to be used in polling API requests.
|
||||
* 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 {Number} [options.webHook.port=8443] Port to bind to
|
||||
|
@ -133,7 +133,7 @@ class TelegramBotPolling {
|
||||
*/
|
||||
_getUpdates() {
|
||||
debug('polling with options: %j', this.options.params);
|
||||
return this.bot._request('getUpdates', this.options.params)
|
||||
return this.bot.getUpdates(this.options.params)
|
||||
.catch(err => {
|
||||
if (err.response && err.response.statusCode === ANOTHER_WEB_HOOK_USED) {
|
||||
return this._unsetWebHook();
|
||||
|
@ -48,7 +48,7 @@ before(function beforeAll() {
|
||||
|
||||
describe('module.exports', function moduleExportsSuite() {
|
||||
const nodeVersion = parseInt(process.versions.node.split('.')[0], 10);
|
||||
it('is loaded from src/ on Node.js v5+', function test() {
|
||||
it('is loaded from src/ on Node.js v5+ and above', function test() {
|
||||
if (nodeVersion <= 4) this.skip(); // skip on Node.js v4 and below
|
||||
assert.equal(TelegramBot, require('../src/telegram'));
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user