Skip to main content

Handler Action

Use this method to track callback_query interactions.

note

Now action can be used for multiple tracking purposes (starting from 0.7.0 and above).

Parameters

ParameterDescription
options.dataThe action data string or an array of action data strings.
options.answerWhether to answer the action. Default is false.
options.codeThe code to be executed when the command is invoked.

Usage Example

<AoiClient>.addCommand({
name: "callback",
code: `
$addCallbackQuery[1;text1;test_data]
$addCallbackQuery[1;text2;data2]
$addCallbackQuery[2;text3;data3]
$addCallbackQuery[2;text4;data4]
$addCallbackQuery[3;text5;data5]
$sendMessage[Text button!]
$sendMessage[No button!]
`,
});

<AoiClient>.addAction({
data: "test_data",
answer: true,
code: `$print[Action]`,
});