wc.commandAction() - shysolocup/willclient GitHub Wiki
- Description: Creates a new slash command listener.
Parts
- ctx
Interaction
: Context of the command's interaction
- cmd
Command
: Info about the command like name, arguments, cooldown, etc
Parameters
- Action
Function
: What it does when a button is pressed
Setup
wc.commandAction( async (ctx, cmd) => {
// action
})
wc.event( "command", async (ctx, cmd) => {
// action
})
wc.event( "commandRan", async (ctx, cmd) => {
// action
})
Example
wc.commandAction( async (ctx, cmd) => {
if (cmd.name == "ping") {
ctx.reply("Pong!")
}
});