Handler Events
To track events, we will need either methods or parameters in the loader.
Available events
readyCommandmessageCommandcallbackQueryCommandeditedMessageCommandchannelPostCommandeditedChannelPostCommandinlineQueryCommandshippingQueryCommandpreCheckoutQueryCommandpollCommandmessageReactionCommandmessageReactionCountCommandchatBoostCommandremovedChatBoostCommandpollAnswerCommandfunctionErrorCommandchatMemberCommandmyChatMemberCommandchatJoinRequestCommandvariableDelete-- functions:$oldVariable[table/variable/data]variableUpdate-- functions:$variable[table/variable/newData/oldData]variableCreate-- functions:$newVariable[table/variable/data]
Available events in the loader
readymessagecallback_queryedited_messagemessage_reactionmessage_reaction_countchannel_postedited_channel_postinline_queryshipping_querypre_checkout_querypollpoll_answerchat_membermy_chat_memberchat_join_requestfunctionErrorremoved_chat_boostchat_boostvariableDeletevariableUpdatevariableCreate
Example
You can implement event handlers in your Telegram bot using methods or by specifying event parameters in the loader.
- JavaScript
- Loader
<AoiClient>.readyCommand({
code: `$print[Starting @$client[username]]`,
});
- ESModule
- Commonjs
export default {
type: "ready",
code: `$print[Starting @$client[username]]`,
};
module.exports = {
type: "ready",
code: `$print[Starting @$client[username]]`,
};