tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Separate message_ids in the same post #2834

Closed Silver-will closed 7 months ago

Silver-will commented 7 months ago

Hi there, I recently noticed that if a message is sent containing several media files then an updateNewMessage response is sent to my update handler as many times as there are media files in said message. And each time the updateNewMessage object has a separate message ID for each media file. So the question is can i somehow get every media file in a single message response all containing the same message id?

levlam commented 7 months ago

No, but you can identify all messages from the media album using message.media_album_id field.

Silver-will commented 7 months ago

@levlam Thank you, grouping them by their media_album_id worked perfectly. This is slightly unrelated but is there a way to send multiple media files with the api? InputMessagePhoto can only take 1 Input File. So do i have to create a new message object for each file, Then recursively call sendMessage ?

levlam commented 7 months ago

You need to use the method sendMessageAlbum.