new Command(data)
Create a command
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | The command data |
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data.name |
String | The command name |
||||||||||||||||||||||||||||||||||||||||||||||||||||
data.desc |
String | The command description |
||||||||||||||||||||||||||||||||||||||||||||||||||||
data.options |
Object |
<optional> |
{} | The command options Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||
data.action |
CommandAction | The command action |
Members
-
private _typePrefixes : Object
-
Argument type prefixes for command info
Properties:
Name Type Description number
String user
String channel
String -
action : CommandAction
-
The command action
-
desc : String
-
The command description
-
info : String
-
Get the info of this command
Example
'**name**|**alias** **<mandatory arg> (optional arg) (#number arg)** - *description*'
-
name : String
-
The command name
-
options : Object
-
The options for the command
Properties:
Name Type Description args
Array<Argument> The arguments for the command
aliases
Array<String> Other names that trigger the command
guide
Object Guide info displayed when a command guide is built with the agent
Properties
Name Type Description color
Number An integer color for the sidebar of the command guide
fields
Array<Object> A list of field objects displayed in the guide
restricted
Boolean Whether or not this command is restricted to admin only
guildOnly
Boolean Whether or not this command can only be triggered in guilds as opposed to DMs
authLevel
Number The minimum auth level required to execute this command