Skip to main content

Class: CommandManager

Constructors

constructor

new CommandManager(app, baseCommands)

Parameters

NameType
appApp
baseCommandsCommand[]

Defined in

packages/disploy/src/commands/CommandManager.ts:18

Properties

app

Private app: App

Defined in

packages/disploy/src/commands/CommandManager.ts:18


commands

Private Readonly commands: Map<string, Command>

Defined in

packages/disploy/src/commands/CommandManager.ts:16

Methods

areSlashCommandsEqual

Private areSlashCommandsEqual(command, existingCommand): boolean

Parameters

NameType
commandChatInputCommand
existingCommandAPIApplicationCommand

Returns

boolean

Defined in

packages/disploy/src/commands/CommandManager.ts:149


filterExistingCommands

Private filterExistingCommands(existingCommands): [Command, APIApplicationCommand][]

Parameters

NameType
existingCommandsRESTGetAPIApplicationCommandsResult

Returns

[Command, APIApplicationCommand][]

Defined in

packages/disploy/src/commands/CommandManager.ts:101


filterNonFrameworkCommands

Private filterNonFrameworkCommands(existingCommands): Command[]

Parameters

NameType
existingCommandsRESTGetAPIApplicationCommandsResult

Returns

Command[]

Defined in

packages/disploy/src/commands/CommandManager.ts:119


getCommands

getCommands(): Map<string, Command>

Get the locally registered commands in this manager

Returns

Map<string, Command>

Registered commands in this manager

Defined in

packages/disploy/src/commands/CommandManager.ts:28


getRegisteredCommands

getRegisteredCommands(options?): Promise<RESTGetAPIApplicationCommandsResult>

Get all registered command on the DAPI for this application

Parameters

NameTypeDescription
options?ObjectOptions for the request
options.guildId?string-
options.onlyFramework?boolean-

Returns

Promise<RESTGetAPIApplicationCommandsResult>

Registered commands for this application on Discord

Defined in

packages/disploy/src/commands/CommandManager.ts:84


registerCommand

registerCommand(command): void

Parameters

NameType
commandCommand

Returns

void

Defined in

packages/disploy/src/commands/CommandManager.ts:32


registerCommandToDiscord

Private registerCommandToDiscord(command, guildId?): Promise<void>

Parameters

NameType
commandCommand
guildId?string

Returns

Promise<void>

Defined in

packages/disploy/src/commands/CommandManager.ts:123


syncCommands

syncCommands(merge?, guildId?): Promise<void>

Sync all registered commands with the DAPI

Parameters

NameTypeDefault valueDescription
mergebooleantrue-
guildId?stringundefinedGuild ID to sync commands for

Returns

Promise<void>

Defined in

packages/disploy/src/commands/CommandManager.ts:43


updateCommandOnDiscord

Private updateCommandOnDiscord(id, command, guildId?): Promise<void>

Parameters

NameType
idstring
commandCommand
guildId?string

Returns

Promise<void>

Defined in

packages/disploy/src/commands/CommandManager.ts:136