node-telegram-bot-api库allowed_updates无效 问题修复
12月20日,2023 telegram 机器人开发 哈二王 4214次
09月22日, 2014 4214次
\node_modules\node-telegram-bot-api\src\telegram.js
line:786
/**
* Use this method to receive incoming updates using long polling.
* This method has an [older, compatible signature][getUpdates-v0.25.0]
* that is being deprecated.
*
* @param {Object} [options] Additional Telegram query options
* @return {Promise}
* @see https://core.telegram.org/bots/api#getupdates
*/
getUpdates(form = {}) {
/* The older method signature was getUpdates(timeout, limit, offset).
* We need to ensure backwards-compatibility while maintaining
* consistency of the method signatures throughout the library */
if (typeof form !== 'object') {
/* eslint-disable no-param-reassign, prefer-rest-params */
deprecate('The method signature getUpdates(timeout, limit, offset) has been deprecated since v0.25.0');
form = {
timeout: arguments[0],
limit: arguments[1],
offset: arguments[2],
};
/* eslint-enable no-param-reassign, prefer-rest-params */
}
const optioons = {
body: form,
json: true,
Headers: {
'Content-Type': 'application/json'
}
}
return this._request('getUpdates', optioons);
}
暂无留言,赶快评论吧