Constructor
new CommandClient(prefixopt, optionsopt)
Class constructor
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
prefix |
string |
<optional> |
'!' | Prefix for commands. |
options |
ClientOptions |
<optional> |
{} | Options to be passed to the Client. |
Extends
- Client
Members
commandNotAllowedMessage :string
Message displayed when usage doesn't have enough privileges to run command.
Type:
- string
enableHelp :boolean
Set if the help is enabled
Type:
- boolean
prefix :string
Prefix of the command
Type:
- string
Methods
editCommandData(command, callback, optionsopt)
Edit command datas (callback, and options, if specified)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
command |
string | The command to edit | ||
callback |
CommandCallback | The new callback function | ||
options |
CommandOptions |
<optional> |
{} | The options to edit (if an existing option isn't set, its value will be unchanged) |
editCommandOptions(command, options)
Edit command options
Parameters:
Name | Type | Description |
---|---|---|
command |
string | The command to edit |
options |
CommandOptions | The options to edit (if an existing option isn't set, its value will be unchanged) |
registerCommand(command, callback, optionsopt)
Register a new command
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
command |
string | Command without the prefix | ||
callback |
CommandCallback | Callback function called when the command is triggered | ||
options |
CommandOptions |
<optional> |
{} | Options evaluated when the command is triggered |
unregisterCommand(command)
Unregisters a command if registered
Parameters:
Name | Type | Description |
---|---|---|
command |
string | Command to unregister |