src: Fix default options in constructors

experimental
GochoMugo 9 years ago
parent a9d6e93622
commit df4d9c06f3
No known key found for this signature in database
GPG Key ID: 7B6A01CB57AA39E4
  1. 4
      src/telegram.js
  2. 2
      src/telegramPolling.js

@ -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…
Cancel
Save