2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 09:57:10 +00:00

src/polling: Fix defaulting value of 'options.polling.params.timeout'

This commit is contained in:
GochoMugo 2017-02-16 11:47:55 +03:00
parent e9106a3d0e
commit 607a39ed5e
No known key found for this signature in database
GPG Key ID: 7B6A01CB57AA39E4

View File

@ -15,11 +15,10 @@ class TelegramBotPolling {
this.options.interval = (typeof this.options.interval === 'number') ? this.options.interval : 300;
this.options.params = (typeof this.options.params === 'object') ? this.options.params : {};
this.options.params.offset = (typeof this.options.params.offset === 'number') ? this.options.params.offset : 0;
this.options.params.timeout = (typeof this.options.params.timeout === 'number') ? this.options.params.timeout : 10;
if (typeof this.options.timeout === 'number') {
deprecate('`options.polling.timeout` is deprecated. Use `options.polling.params` instead.');
this.options.params.timeout = this.options.timeout;
} else {
this.options.params.timeout = 10;
}
this._lastUpdate = 0;
this._lastRequest = null;