Skip to main content

messages.sendMultiMedia

Send an album or grouped media

func (c *Client) MessagesSendMultiMedia(ctx context.Context, request *MessagesSendMultiMediaRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesSendMultiMedia(ctx, &tg.MessagesSendMultiMediaRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
SilentboolWhether to send the album silently (no notification triggered)
BackgroundboolSend in background?
ClearDraftboolWhether to clear drafts
NoforwardsboolOnly for bots, disallows forwarding and saving of the messages, even if the destination chat doesn't have content protection enabled
UpdateStickersetsOrderboolWhether to move used stickersets to top, see here for more info on this flag »
InvertMediaboolIf set, any eventual webpage preview will be shown on top of the message instead of at the bottom.
AllowPaidFloodskipboolBots only: if set, allows sending up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
PeerInputPeerClassyesThe destination chat
ReplyToInputReplyToClassIf set, indicates that the message should be sent in reply to the specified message or story.
MultiMedia[]InputSingleMediayesThe medias to send: note that they must be separately uploaded using messages uploadMedia first, using raw inputMediaUploaded* constructors is not supported.
ScheduleDateintScheduled message date for scheduled messages
SendAsInputPeerClassSend this message as the specified peer
QuickReplyShortcutInputQuickReplyShortcutClassAdd the message to the specified quick reply shortcut », instead.
Effectint64Specifies a message effect » to use for the message.
AllowPaidStarsint64For paid messages », specifies the amount of Telegram Stars the user has agreed to pay in order to send the message.

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400BUSINESS_CONNECTION_INVALIDThe connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
400BUSINESS_PEER_INVALIDMessages can't be set to the specified peer through the current business connection.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_FORWARDS_RESTRICTEDYou can't forward messages from a protected chat.
403CHAT_SEND_MEDIA_FORBIDDENYou can't send media in this chat.
403CHAT_SEND_PHOTOS_FORBIDDENYou can't send photos in this chat.
403CHAT_SEND_VIDEOS_FORBIDDENYou can't send videos in this chat.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400EFFECT_ID_INVALIDThe specified effect ID is invalid.
400ENTITY_BOUNDS_INVALIDA specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length.
400MEDIA_CAPTION_TOO_LONGThe caption is too long.
400MEDIA_EMPTYThe provided media object is invalid.
400MEDIA_INVALIDMedia invalid.
400MSG_ID_INVALIDInvalid message ID provided.
400MULTI_MEDIA_TOO_LONGToo many media files for album.
406PEER_ID_INVALIDThe provided peer id is invalid.
400QUICK_REPLIES_BOT_NOT_ALLOWEDQuick replies cannot be used by bots.
400QUICK_REPLIES_TOO_MUCHA maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached.
500RANDOM_ID_DUPLICATEYou provided a random ID that was already used.
400RANDOM_ID_EMPTYRandom ID empty.
400REPLY_MESSAGES_TOO_MUCHEach shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached.
400REPLY_TO_INVALIDThe specified reply_to field is invalid.
400SCHEDULE_DATE_TOO_LATEYou can't schedule a message this far in the future.
400SCHEDULE_TOO_MUCHThere are too many scheduled messages.
400SEND_AS_PEER_INVALIDYou can't send messages as the specified peer.
400TOPIC_CLOSEDThis topic was closed, you can't send messages to it anymore.
400TOPIC_DELETEDThe specified topic was deleted.
400USER_BANNED_IN_CHANNELYou're banned from sending messages in supergroups/channels.

References