Class

Manager

Manager()

Represents the command manager.
Constructor

# new Manager()

Properties:
Name Type Description
token Object The bot's token.
options Object The options for the command manager.

View Source index.js, line 125

Extends

Members

String

# api_url

The discord API url.
Overrides:
Default Value:
  • "https://discord.com/api/v9"

View Source index.js, line 29

Object

# app

The bot's application.
Overrides:

View Source index.js, line 37

Object

# options

The options for the command manager.
Overrides:

View Source index.js, line 22

String

# token

The bot's token.
Overrides:

View Source index.js, line 15

Object

# utils

The utils functions used by the command manager.
Properties:
Name Type Description
separateCommand function Checks the command and separate the commands and groups of commands.
Overrides:

View Source index.js, line 44

Methods

# async deleteCommand(commandID, guildopt) → {Promise.<Object>}

Delete a application command.
Parameters:
Name Type Attributes Description
commandID String The ID of the command to delete.
guild String <optional>
The guild id to delete the command, if is undefined will delete global command.

View Source index.js, line 218

The deleted command object.
Promise.<Object>

# async editCommand(commandID, command, guildopt) → {Promise.<Object>}

Edit a application command.
Parameters:
Name Type Attributes Description
commandID String The ID of the command to edit.
command Object The new command object.
guild String <optional>
the guild id to edit the command, if is undefined will edit global command.

View Source index.js, line 174

The new command object.
Promise.<Object>

# async getCommands(guildopt) → {Promise.<Object>}

Get application commands.
Parameters:
Name Type Attributes Description
guild String <optional>
Guild id to get commands, if is undefined will get global commands.
Overrides:

View Source index.js, line 94

Promise.<Object>

# async registerCommand(command, guildopt) → {Promise.<Object>}

Register a new application command.
Parameters:
Name Type Attributes Description
command Object The command object.
guild String <optional>
The guild id to register the command, if is undefined will register global command.

View Source index.js, line 137

The new command object.
Promise.<Object>

# async searchCommand(commandName, guildopt) → {Promise.<Array>}

Search for a application command.
Parameters:
Name Type Attributes Description
commandName String The name of the command to search.
guild String <optional>
The guild id to search the command, if is undefined will search global command.

View Source index.js, line 257

The commands matching the name.
Promise.<Array>

# async start() → {Boolean}

Start the command manager.
Overrides:

View Source index.js, line 59

Returns true if the manager was started, otherwise returns an error.
Boolean

# stop() → {Boolean}

Stop the command manager.
Overrides:

View Source index.js, line 83

Returns true to indicate that the manager is stopped.
Boolean