Type Definitions
CommandCallback(messageopt, commandNameopt, argsopt)
The callback function called when a valid command is typed
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
Message |
<optional> |
Discord.js Message sent by user |
commandName |
string |
<optional> |
Command name, without the prefix |
args |
Array.<string> |
<optional> |
Arguments passed to the command, sliced following spaces |
CommandInfos
Stores the informations about the command
Type:
- Object
CommandOptions
Options for a command
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
minArgs |
number |
<optional> |
0 | Minimum arguments required to trigger the event |
maxArgs |
number |
<optional> |
-1 | Maximum arguments allowed to trigger the event |
displayInHelp |
boolean |
<optional> |
true | If false, the command will not be displayed in the help |
helpMessage |
string |
<optional> |
"No help available" | Contains the help message displayed when user uses help command |
usageMessage |
UsageMessage |
<optional> |
"" | Contains the message displayed when the command is badly used. |
requiredPermission |
PermissionResolvable |
<optional> |
0 | Store the permission required to use the command (Will be ignored in DM/Group DM) |
dmAllowed |
boolean |
<optional> |
false | If false, the event isn't triggered when the command is sent by PM |
UsageMessage
The usage message. It's a string, but you can type %p, which will be replaced by the prefix, %c, replaced by the command name (without prefix), and %f, replaced by the full command (with prefix)
Type:
- string