Commands
Commands are the principal objects of this library, you can see here how to create a command and the default values of each options :
Example
And you can see a "complete" example of what a command could look like :
You have to put the command into a category folder into your commands folder like in the examples & tests.
This will also automatically set the category
property of the command. And this is why the property is not defined in this example.
Important Notes
Do not use the run(ctx)
command if you use a custom message
event, use instead the execute(ctx)
method because it will return the result of the validate(ctx)
method that returns an error in multiple cases
Errors from validation
This is returned in an object containing the error message, the error type (from an enum) and the data.
Last updated