简体   繁体   中英

Forward a message with multiple media files using bot Telegram API

I'm having a problem forwarding messages with multiple media files (in my particular case, photos).

I'm using forwardMessage method to forward the message that user sends to bot (which, in some cases, might contain more than one photo):

bot.forwardMessage(admin_id, from_chat_id, message_id)

But, the thing is, according to Telegram API v3.5, the message which contain media group breaks up into array of messages, and hence the bot breaks up the message from user into multiple messages. Eg if user have sent a message with 3 photos, then the bot forwards 3 messages, each of which contains a photo.

What I want is to forward a message with multiple media files as it is, as one message, not as multiple messages.

I know that probably I can take each photo from each message that the bot receives, put them one-by-one into array, and then send it from the bot using sendMediaGroup method, but I'd like to know if I can get it working with forwardMessage method.

Thanks in advance.

You can't forward original content via forwardMessage , for instance, you can't forward with an inline keyboard.

I think this may be a mistake, you can suggest that to @BotSupport .

Telegram API had updated a method call sendMediaGroup for sending images as album.

https://core.telegram.org/bots/api#sendmediagroup

Have a look :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM