mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-28 04:47:38 +00:00
src/polling: Fix defaulting value of 'options.polling.params.timeout'
This commit is contained in:
parent
e9106a3d0e
commit
607a39ed5e
@ -15,11 +15,10 @@ class TelegramBotPolling {
|
|||||||
this.options.interval = (typeof this.options.interval === 'number') ? this.options.interval : 300;
|
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 = (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.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') {
|
if (typeof this.options.timeout === 'number') {
|
||||||
deprecate('`options.polling.timeout` is deprecated. Use `options.polling.params` instead.');
|
deprecate('`options.polling.timeout` is deprecated. Use `options.polling.params` instead.');
|
||||||
this.options.params.timeout = this.options.timeout;
|
this.options.params.timeout = this.options.timeout;
|
||||||
} else {
|
|
||||||
this.options.params.timeout = 10;
|
|
||||||
}
|
}
|
||||||
this._lastUpdate = 0;
|
this._lastUpdate = 0;
|
||||||
this._lastRequest = null;
|
this._lastRequest = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user