2
0
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:
GochoMugo 2017-01-13 10:52:43 +03:00
parent a9d6e93622
commit df4d9c06f3
No known key found for this signature in database
GPG Key ID: 7B6A01CB57AA39E4
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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;