bots.sendCustomRequest

Sends a custom request; for bots only

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.bots.sendCustomRequest({
        customMethod: 'random string here',
        params: new Api.DataJSON({...}),
        }));
    console.log(result); // prints the result
})();

TL schema

dataJSON#7d748d04 data:string = DataJSON;
---functions---
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;

Parameters

Result

DataJSON

Possible errors

Can bots use this methd ?

yes

Last updated