Class: CommandManager

CommandManager()

Manages the commands.

Constructor

new CommandManager()

Instantiates a new command manager.
Source:

Members

plain

Registered commands including aliases
Source:

registered

Registered commands
Source:

Methods

(async) processMessage(msg, content)

Processes a message.
Parameters:
Name Type Description
msg Discord.Message
content string Overrides msg.content
Source:

register(name, options, func) → {BotCommand|Array.<BotCommand>}

Registers command(s). First parameter can be either a name, or a {BotCommand} instance or array. Second parameter can be an object containg options, or the handler function. Third parameter is the handler function when options are the second. If a command with the same name exists, it will be overwritten.
Parameters:
Name Type Description
name string | Array.<string> | BotCommand | Array.<BotCommand> Name or instance of the command
options object Command options
func function Function to execute
Source:
See:
Returns:
The registered command instance(s).
Type
BotCommand | Array.<BotCommand>

run(name, msg, args)

Executes a command.
Parameters:
Name Type Description
name string Name of the command
msg object Discordie IMessage
args string | Array.<string> Arguments
Source:

unregister(c)

Unregisters command(s) First parameter can be either a name, a {BotCommand} instance or an array of both.
Parameters:
Name Type Description
c string | BotCommand | Array Command(s) to unregister.
Source: