messages.setBotCallbackAnswer

Set the callback answer to a user button press (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.messages.setBotCallbackAnswer({
        alert: true,
        queryId: 5130910,
        message: 'random string here',
        url: 'random string here',
        cacheTime: 3996368,
        }));
    console.log(result); // prints the result
})();

TL schema

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool;

Parameters

Name

Type

Description

flags

alert

Whether to show the message as a popup instead of a toast notification

query_id

Query ID

message

Popup to show

url

URL to open

cache_time

Cache validity

Result

Bool

Possible errors

Code

Type

Description

400

QUERY_ID_INVALID

The query ID is invalid

400

URL_INVALID

Invalid URL provided

Can bots use this methd ?

yes

Last updated