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
})();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.setBotCallbackAnswer({
alert: true,
queryId: 5130910,
message: 'random string here',
url: 'random string here',
cacheTime: 3996368,
}));
console.log(result); // prints the result
})();TL schema
Parameters
Result
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
Related pages
Last updated
Was this helpful?