Commander

Commander

Commander class for command processing

Constructor

new Commander(client)

Source:
Properties:
Name Type Description
prefixes Set

Set of added prefixes

Creates a new Commander instance

Parameters:
Name Type Description
client Client

Client instance

Methods

attach(Command, groupopt, prefixopt) → {Commander}

Source:

Attaches a command

Parameters:
Name Type Attributes Default Description
Command AbstractCommand

Command class, object or function

group String <optional>
misc

Default command group, will be overwritten by group setting in the command

prefix String <optional>

Default command prefix, will be overwritten by prefix setting in the command

Returns:
Type
Commander

eject(trigger) → {Commander}

Source:

Ejects a command

Parameters:
Name Type Description
trigger String

The command trigger

Returns:
Type
Commander

ejectGroup(groupopt, triggeropt) → {Commander}

Source:

Ejects a command group

Parameters:
Name Type Attributes Default Description
group String <optional>
'*

The command group to be ejected

trigger String <optional>

The command trigger in the group

Returns:
Type
Commander

execute(trigger, …args)

Source:

Executes a command

Parameters:
Name Type Attributes Description
trigger String

The trigger of the command to be executed

args * <repeatable>

Arguments to be supplied to the command

register(commands, optionsopt) → {Client}

Source:

Registers commands

Parameters:
Name Type Attributes Description
commands String | Object | Array

An object, array or relative path to a folder or file to load commands from

options Object <optional>

Additional command options

Properties
Name Type Attributes Description
prefix String <optional>

Command prefix, will be overwritten by prefix setting in the command

groupedCommands Boolean <optional>

Option for object/path supplied to be an object of objects with command groups as keys

Returns:
Type
Client

reload() → {Client}

Source:

Reloads command files (only those that have been added from by file path)

Returns:
Type
Client

unregister(groupnullable, triggeropt) → {Commander}

Source:

Unregisters a command group or trigger

Parameters:
Name Type Attributes Description
group String <nullable>

The command group

trigger String <optional>

The command trigger

Returns:
Type
Commander