mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-28 21:07:39 +00:00
Proxy extra request options (PR #178)
This commit is contained in:
parent
d4a5f5d16c
commit
afd2373351
@ -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…
x
Reference in New Issue
Block a user