messages.sendMultiMedia

Send an album or grouped media

Example

const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.messages.sendMultiMedia({
        silent: true,
        background: true,
        clearDraft: true,
        peer: new Api.InputPeer({...}),
        replyToMsgId: 9838180,
        multiMedia: [new Api.InputSingleMedia({...})],
        scheduleDate: 6930295,
        }));
    console.log(result); // prints the result
})();

TL schema

Parameters

Name

Type

Description

flags

silent

Whether to send the album silently (no notification triggered)

background

Send in background?

clear_draft

Whether to clear drafts

peer

The destination chat

reply_to_msg_id

The message to reply to

multi_media

The medias to send

schedule_date

Scheduled message date for scheduled messages

Result

Updates

Possible errors

Code

Type

Description

400

CHAT_ADMIN_REQUIRED

You must be an admin in this chat to do this

400

MEDIA_EMPTY

The provided media object is invalid

400

MEDIA_INVALID

Media invalid

400

MULTI_MEDIA_TOO_LONG

Too many media files for album

400

PEER_ID_INVALID

The provided peer id is invalid

400

RANDOM_ID_EMPTY

Random ID empty

Can bots use this methd ?

yes

How to handle message drafts

How to transfer large data batches correctly.

Last updated

Was this helpful?