-
-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Labels
enhancementNew feature or requestNew feature or request
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!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request