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
Case
The data it returns
When the user is still in a cooldown.
The remaining time to wait for the user.
When the command has a list of channel and is not executed in one.
Nothing
When the client is missing permissions defined for the command.
The missing permissions in a sorted array.
When the user is missing permissions defined for the command.
The missing permissions in a sorted array.
When the tags are not all satisfied.
The tags not satisfied.
This is returned in an object containing the error message, the error type (from an enum) and the data.
Last updated