Command(data)

Class representing a command

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
Name Type Attributes Default Description
args Array<(ArgData|String)> <optional>
[]

The arguments for the command (Can be an argument data object or just the name of the argument)

aliases Array<String> | String <optional>
[]

Other names that trigger the command

guide Object <optional>
{}

Guide info displayed when a command guide is built with the agent

Properties
Name Type Attributes Default Description
color Number <optional>
16777215

An integer color for the sidebar of the command guide

fields Array<Object> <optional>
[]

A list of field objects displayed in the guide

restricted Boolean <optional>
false

Whether or not this command is restricted to admin only

guildOnly Boolean <optional>
false

Whether or not this command can only be triggered in guilds as opposed to DMs

authLevel Number <optional>
0

The minimum auth level required to execute this command

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