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
Parameter | Description |
---|---|
options.data | The action data string or an array of action data strings. |
options.answer | Whether to answer the action. Default is false . |
options.code | The code to be executed when the command is invoked. |
Usage Example
- JavaScript
- Loader
<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]`,
});
- ESModule
- Commonjs
export default {
data: "test_data",
answer: true,
code: `$print[Action]`,
};
module.exports = {
data: "test_data",
answer: true,
code: `$print[Action]`,
};