messages.saveDraft

Save a message draftarrow-up-right associated to a chat.

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.saveDraft({
        noWebpage: true,
        replyToMsgId: 255667,
        peer: new Api.InputPeer({...}),
        message: 'random string here',
        entities: [new Api.MessageEntity({...})],
        }));
    console.log(result); // prints the result
})();

TL schema

Parameters

Name

Type

Description

no_webpage

Disable generation of the webpage preview

reply_to_msg_id

Message ID the message should reply to

peer

Destination of the message that should be sent

message

The draft

Result

Boolarrow-up-right

Possible errors

Code

Type

Description

400

PEER_ID_INVALID

The provided peer id is invalid

Can bots use this methd ?

yes

How to create styled text with message entities

How to handle message drafts

Last updated