Available methods

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

parametertyperequireddescription
business_connection_idstringoptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
message_thread_idnumberoptionalUnique 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_idnumberoptionalIdentifier 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)[]requiredA JSON-serialized array describing messages to be sent, must include 2-10 items
disable_notificationbooleanoptionalSends messages silently. Users will receive a notification with no sound.
protect_contentbooleanoptionalProtects the contents of the sent messages from forwarding and saving
allow_paid_broadcastbooleanoptionalPass 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_idstringoptionalUnique identifier of the message effect to be added to the message; for private chats only
reply_parametersReplyParametersoptionalDescription 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.

bot.ts
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.

context shortcut
/** 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">)