messages.sendMessage
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.sendMessage({
noWebpage: true,
silent: true,
background: true,
clearDraft: true,
peer: new Api.InputPeer({...}),
replyToMsgId: 6872073,
message: 'random string here',
randomId: 1848690,
replyMarkup: new Api.ReplyMarkup({...}),
entities: [new Api.MessageEntity({...})],
scheduleDate: 789917,
}));
console.log(result); // prints the result
})();TL schema
Parameters
Result
Possible errors
Can bots use this methd ?
yes
Related pages
Last updated