CommandController

CommandController

Controller for Discord bot Commands

Constructor

new CommandController()

Source:

Methods

determinePrefix(message) → {String|Boolean}

Source:

Determines the command prefix for a provided message

Parameters:
Name Type Description
message external:Message

discord.js Message

Returns:

prefix string or false

Type
String | Boolean

executeCommand(config) → {Message}

Source:

Executes a Command

Parameters:
Name Type Description
config Object

configuration object

Properties
Name Type Description
command Command

Discord bot Command

args Array.<String>

array of argument strings

message Message

Discord Message

Returns:
Type
Message

findCommand(commandName) → {Command}

Source:

Finds a matching Command

Parameters:
Name Type Description
commandName String

name or alias of command

Returns:
Type
Command

init(config)

Source:

Initializes a new CommandController

Parameters:
Name Type Description
config Object

configuration object

Properties
Name Type Attributes Default Description
server Esdi

Esdi server instance

botPrefix String <optional>
'esdi!'

prefix for Commands

start()

Source:

Starts the CommandController

Listens to Events:

stop()

Source:

Stops the CommandController

Listens to Events: