Proxy extra request options (PR #178)

experimental
Alexander Tarmolov 9 years ago committed by Gocho Mugo
parent d4a5f5d16c
commit afd2373351
  1. 5
      src/telegram.js

@ -42,6 +42,7 @@ class TelegramBot extends EventEmitter {
* @param {String} [options.webHook.key] PEM private key to webHook server.
* @param {String} [options.webHook.cert] PEM certificate (public) to webHook server.
* @param {Boolean} [options.onlyFirstMatch=false] Set to true to stop after first match. Otherwise, all regexps are executed
* @param {Object} [options.request] Options which will be added for all requests to telegram api.
* @see https://core.telegram.org/bots/api
*/
constructor(token, options = {}) {
@ -168,6 +169,10 @@ class TelegramBot extends EventEmitter {
throw new Error('Telegram Bot Token not provided!');
}
if (this.options.request) {
Object.assign(options, this.options.request);
}
if (options.form) {
this._fixReplyMarkup(options.form);
}

Loading…
Cancel
Save