messages.sendMultiMedia #

Send an album or grouped media

Layer 223

updatesTooLong#e317af7e = Updates;
updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShort#78d4dec1 update:Update date:int = Updates;
updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
---functions---
messages.sendMultiMedia#1bf89d74 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
silentflags.5?trueWhether to send the album silently (no notification triggered)
backgroundflags.6?trueSend in background?
clear_draftflags.7?trueWhether to clear drafts
noforwardsflags.14?trueOnly for bots, disallows forwarding and saving of the messages, even if the destination chat doesn't have content protection enabled
update_stickersets_orderflags.15?trueWhether to move used stickersets to top, see here for more info on this flag »
invert_mediaflags.16?trueIf set, any eventual webpage preview will be shown on top of the message instead of at the bottom.
allow_paid_floodskipflags.19?trueBots 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.
peerInputPeerThe destination chat
reply_toflags.0?InputReplyToIf set, indicates that the message should be sent in reply to the specified message or story.
multi_mediaVector<InputSingleMedia>The medias to send: note that they must be separately uploaded using messages.uploadMedia first, using raw inputMediaUploaded* constructors is not supported.
schedule_dateflags.10?intScheduled message date for scheduled messages
send_asflags.13?InputPeerSend this message as the specified peer
quick_reply_shortcutflags.17?InputQuickReplyShortcutAdd the message to the specified quick reply shortcut », instead.
effectflags.18?longSpecifies a message effect » to use for the message.
allow_paid_starsflags.21?longFor paid messages », specifies the amount of Telegram Stars the user has agreed to pay in order to send the message.

Result #

Updates

Both users and bots can use this method #

This method can be invoked over a business connection » #

Possible errors #

CodeTypeDescription
403ALLOW_PAYMENT_REQUIRED_%dThis peer charges %d Telegram Stars per message, but the allow_paid_stars was not set or its value is smaller than %d.
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.
400FILE_REFERENCE_%d_EMPTYThe file reference of the media file at offset %d in the multi_media array is invalid.
400FILE_REFERENCE_%d_EXPIREDThe file reference of the media file at index %d in the passed media array expired, it must be refreshed as specified in the documentation. .
400FILE_REFERENCE_%d_INVALIDThe file reference of the media file at index %d in the passed media array is invalid.
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.
403PRIVACY_PREMIUM_REQUIREDYou need a Telegram Premium subscription to send a message to this user.
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.
420SLOWMODE_WAIT_%dSlowmode is enabled in this chat: wait %d seconds before sending another message to this chat.
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.
400USER_IS_BLOCKEDYou were blocked by this user.

Message drafts #

How to handle message drafts

Stickers and masks #

Telegram clients support displaying static and animated stickers.

Bots FAQ #

messages.uploadMedia #

Upload a file and associate it to a chat (without actually sending it to the chat)

May also be used in a business connection, not by wrapping the query in invokeWithBusinessConnection », but rather by specifying the business connection ID in the business_connection_id parameter.

Telegram Business #

Users can turn their Telegram account into a business account, gaining access to business features such as opening hours, location, quick replies, automated messages, custom start pages, chatbot support, and more.

Animated message effects #

Telegram allows adding spectacular animated effects to messages you send.

Telegram Stars can be used to pay for sending messages to users, supergroups and channels that have configured paid messages, requiring a payment for every message sent to them.

Telegram Stars #

Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.

Uploading and Downloading Files #

How to transfer large data batches correctly.

Styled text with message entities #

How to create styled text with message entities

File references #

How to handle file references.

Telegram Premium #

Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.

Client configuration #

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.