sendMediaGroup()
Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Message objects that were sent is returned.
parameters
| parameter | type | required | description |
|---|---|---|---|
business_connection_id | string | optional | Unique identifier of the business connection on behalf of which the message will be sent |
chat_id | number | string | required | Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username |
message_thread_id | number | optional | Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only |
direct_messages_topic_id | number | optional | Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat |
media | (InputMediaAudio | InputMediaDocument | InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo)[] | required | A JSON-serialized array describing messages to be sent, must include 2-10 items |
disable_notification | boolean | optional | Sends messages silently. Users will receive a notification with no sound. |
protect_content | boolean | optional | Protects the contents of the sent messages from forwarding and saving |
allow_paid_broadcast | boolean | optional | Pass True to allow 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. |
message_effect_id | string | optional | Unique identifier of the message effect to be added to the message; for private chats only |
reply_parameters | ReplyParameters | optional | Description of the message to reply to |
returns
Message[]
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { Message, SendMediaGroupParams } from "@yaebal/types";
await bot.api.call<Message[]>("sendMediaGroup", {
chat_id: 123456789,
media: [],
} satisfies SendMediaGroupParams);context shortcut
also available as ctx.sendMediaGroup() on
16
context types — see @yaebal/contexts.
/** Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of [Message](https://core.telegram.org/bots/api/#message) objects that were sent is returned. */
ctx.sendMediaGroup(params: Omit<SendMediaGroupParams, "chat_id">)official Bot API docs: https://core.telegram.org/bots/api/#sendmediagroup