mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-29 13:27:44 +00:00
src: Fix default options in constructors
This commit is contained in:
parent
a9d6e93622
commit
df4d9c06f3
@ -71,8 +71,10 @@ class TelegramBot extends EventEmitter {
|
||||
super();
|
||||
this.token = token;
|
||||
this.options = options;
|
||||
this.options.polling = (typeof options.polling === 'undefined') ? false : options.polling;
|
||||
this.options.webHook = (typeof options.webHook === 'undefined') ? false : options.webHook;
|
||||
this.options.baseApiUrl = options.baseApiUrl || 'https://api.telegram.org';
|
||||
this.options.filepath = typeof options.filepath === 'undefined' ? true : options.filepath;
|
||||
this.options.filepath = (typeof options.filepath === 'undefined') ? true : options.filepath;
|
||||
this._textRegexpCallbacks = [];
|
||||
this._onReplyToMessages = [];
|
||||
this._polling = null;
|
||||
|
@ -25,7 +25,7 @@ class TelegramBotPolling {
|
||||
|
||||
this.request = request;
|
||||
this.options = options;
|
||||
this.options.timeout = options.timeout || 10;
|
||||
this.options.timeout = (typeof options.timeout === 'number') ? options.timeout : 10;
|
||||
this.options.interval = (typeof options.interval === 'number') ? options.interval : 300;
|
||||
this.callback = callback;
|
||||
this._offset = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user