Open
Description
I am trying to send multiple media files (e.g., images) in a single post using MessagesSendMultiMedia, but I keep getting the error:
rpc error code 400: MEDIA_INVALID
_, err = v1.tgBot.Client.API().MessagesSendMultiMedia(context.Background(), &tg.MessagesSendMultiMediaRequest{
Peer: &tg.InputPeerChat{ChatID: groupId},
MultiMedia: []tg.InputSingleMedia{
{
Media: &tg.InputMediaUploadedPhoto{File: inputFile},
RandomID: rand.Int63(),
Message: post.Text,
},
{
Media: &tg.InputMediaUploadedPhoto{File: inputFile},
RandomID: rand.Int63(),
},
},
})
What I Tried:
- Verified that inputFile is correctly uploaded and contains valid ID, Parts, and MD5Checksum.
- Ensured &inputFile is correctly assigned (also tried inputFile without pointer).
- Tried InputMediaUploadedDocument instead of InputMediaUploadedPhoto (same error).
- Attempted adding Flags: 1, but GroupedID is not available in InputSingleMedia.
Questions: - How can I send multiple media files in a single post instead of separate messages?
- Is there a way to properly group media items using MessagesSendMultiMedia?
- Does InputSingleMedia support GroupedID, or is there another approach?
Would appreciate any insights or suggestions. Thanks!
Activity