Class: CommandClient

CommandClient(prefixopt, optionsopt)

Represents a bot which supports commands. Discord.js Client class documentation.

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.
Source:

Extends

  • Client

Members

commandNotAllowedMessage :string

Message displayed when usage doesn't have enough privileges to run command.
Type:
  • string
Default Value:
  • "You aren't allowed to run this command."
Source:

enableHelp :boolean

Set if the help is enabled
Type:
  • boolean
Source:

prefix :string

Prefix of the command
Type:
  • string
Source:

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)
Source:

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)
Source:

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
Source:

unregisterCommand(command)

Unregisters a command if registered
Parameters:
Name Type Description
command string Command to unregister
Source: