From ac82d630b44d3c211799a330f87ae18a49449149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=94=E7=98=A6=E5=AD=90m?= Date: Mon, 15 Jul 2024 17:47:16 +0800 Subject: [PATCH] fix: forwardMessages yagop#1215 --- src/telegram.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/telegram.js b/src/telegram.js index b527a9f8..aea24cc5 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -255,6 +255,13 @@ class TelegramBot extends EventEmitter { } } + _fixMessageIds(obj) { + const messageIds = obj.message_ids; + if (messageIds && typeof messageIds !== 'string') { + obj.message_ids = stringify(messageIds); + } + } + /** * Fix 'reply_parameters' parameter by making it JSON-serialized, as * required by the Telegram Bot API @@ -288,6 +295,7 @@ class TelegramBot extends EventEmitter { this._fixReplyMarkup(options.form); this._fixEntitiesField(options.form); this._fixReplyParameters(options.form); + this._fixMessageIds(options.form); } if (options.qs) { this._fixReplyMarkup(options.qs);