Skip to content

ApplicationCommandManager

Defined in: packages/managers/src/application.ts:21

Manages global and guild-scoped application commands for a Discord application.

new ApplicationCommandManager(rest, applicationId): ApplicationCommandManager

Defined in: packages/managers/src/application.ts:26

Creates an application command manager.

REST

REST transport.

string

Application identifier.

ApplicationCommandManager

create(data): Promise<APIApplicationCommand>

Defined in: packages/managers/src/application.ts:41

Creates a single global application command.

ApplicationCommandInput

Command data.

Promise<APIApplicationCommand>

Created command.


createGuild(guildId, data): Promise<APIApplicationCommand>

Defined in: packages/managers/src/application.ts:88

Creates a single guild-scoped application command.

string

Guild identifier.

ApplicationCommandInput

Command data.

Promise<APIApplicationCommand>

Created command.


delete(commandId): Promise<void>

Defined in: packages/managers/src/application.ts:72

Deletes a global application command.

string

Command identifier.

Promise<void>

Nothing.


deleteGuild(guildId, commandId): Promise<void>

Defined in: packages/managers/src/application.ts:126

Deletes a guild-scoped application command.

string

Guild identifier.

string

Command identifier.

Promise<void>

Nothing.


edit(commandId, data): Promise<APIApplicationCommand>

Defined in: packages/managers/src/application.ts:61

Edits a global application command.

string

Command identifier.

ApplicationCommandInput | Partial<ApplicationCommandData>

Partial command data.

Promise<APIApplicationCommand>

Updated command.


editGuild(guildId, commandId, data): Promise<APIApplicationCommand>

Defined in: packages/managers/src/application.ts:110

Edits a guild-scoped application command.

string

Guild identifier.

string

Command identifier.

ApplicationCommandInput | Partial<ApplicationCommandData>

Partial command data.

Promise<APIApplicationCommand>

Updated command.


fetch(): Promise<APIApplicationCommand[]>

Defined in: packages/managers/src/application.ts:34

Fetches all global application commands.

Promise<APIApplicationCommand[]>

Array of registered commands.


fetchGuild(guildId): Promise<APIApplicationCommand[]>

Defined in: packages/managers/src/application.ts:81

Fetches all guild-scoped application commands.

string

Guild identifier.

Promise<APIApplicationCommand[]>

Array of registered guild commands.


set(commands): Promise<APIApplicationCommand[]>

Defined in: packages/managers/src/application.ts:51

Overwrites all global application commands atomically.

readonly ApplicationCommandInput[]

Array of command data.

Promise<APIApplicationCommand[]>

New full command list.


setGuild(guildId, commands): Promise<APIApplicationCommand[]>

Defined in: packages/managers/src/application.ts:99

Overwrites all guild-scoped application commands atomically.

string

Guild identifier.

readonly ApplicationCommandInput[]

Array of command data.

Promise<APIApplicationCommand[]>

New full command list.