messages.saveDraft
Save a message draft 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
})();import {Api, TelegramClient} from 'telegram';
import {StringSession} from 'telegram/sessions';
const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});
(async function run() {
const result: Api.Bool = 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
Result
Possible errors
Code
Type
Description
400
PEER_ID_INVALID
The provided peer id is invalid
Can bots use this methd ?
yes
Related pages
How to create styled text with message entities
How to handle message drafts
Last updated
Was this helpful?