ApplicationCommandManager
Defined in: packages/managers/src/application.ts:21
Manages global and guild-scoped application commands for a Discord application.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ApplicationCommandManager(
rest,applicationId):ApplicationCommandManager
Defined in: packages/managers/src/application.ts:26
Creates an application command manager.
Parameters
Section titled “Parameters”REST transport.
applicationId
Section titled “applicationId”string
Application identifier.
Returns
Section titled “Returns”ApplicationCommandManager
Methods
Section titled “Methods”create()
Section titled “create()”create(
data):Promise<APIApplicationCommand>
Defined in: packages/managers/src/application.ts:41
Creates a single global application command.
Parameters
Section titled “Parameters”Command data.
Returns
Section titled “Returns”Promise<APIApplicationCommand>
Created command.
createGuild()
Section titled “createGuild()”createGuild(
guildId,data):Promise<APIApplicationCommand>
Defined in: packages/managers/src/application.ts:88
Creates a single guild-scoped application command.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Command data.
Returns
Section titled “Returns”Promise<APIApplicationCommand>
Created command.
delete()
Section titled “delete()”delete(
commandId):Promise<void>
Defined in: packages/managers/src/application.ts:72
Deletes a global application command.
Parameters
Section titled “Parameters”commandId
Section titled “commandId”string
Command identifier.
Returns
Section titled “Returns”Promise<void>
Nothing.
deleteGuild()
Section titled “deleteGuild()”deleteGuild(
guildId,commandId):Promise<void>
Defined in: packages/managers/src/application.ts:126
Deletes a guild-scoped application command.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
commandId
Section titled “commandId”string
Command identifier.
Returns
Section titled “Returns”Promise<void>
Nothing.
edit()
Section titled “edit()”edit(
commandId,data):Promise<APIApplicationCommand>
Defined in: packages/managers/src/application.ts:61
Edits a global application command.
Parameters
Section titled “Parameters”commandId
Section titled “commandId”string
Command identifier.
ApplicationCommandInput | Partial<ApplicationCommandData>
Partial command data.
Returns
Section titled “Returns”Promise<APIApplicationCommand>
Updated command.
editGuild()
Section titled “editGuild()”editGuild(
guildId,commandId,data):Promise<APIApplicationCommand>
Defined in: packages/managers/src/application.ts:110
Edits a guild-scoped application command.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
commandId
Section titled “commandId”string
Command identifier.
ApplicationCommandInput | Partial<ApplicationCommandData>
Partial command data.
Returns
Section titled “Returns”Promise<APIApplicationCommand>
Updated command.
fetch()
Section titled “fetch()”fetch():
Promise<APIApplicationCommand[]>
Defined in: packages/managers/src/application.ts:34
Fetches all global application commands.
Returns
Section titled “Returns”Promise<APIApplicationCommand[]>
Array of registered commands.
fetchGuild()
Section titled “fetchGuild()”fetchGuild(
guildId):Promise<APIApplicationCommand[]>
Defined in: packages/managers/src/application.ts:81
Fetches all guild-scoped application commands.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”commands
Section titled “commands”readonly ApplicationCommandInput[]
Array of command data.
Returns
Section titled “Returns”Promise<APIApplicationCommand[]>
New full command list.
setGuild()
Section titled “setGuild()”setGuild(
guildId,commands):Promise<APIApplicationCommand[]>
Defined in: packages/managers/src/application.ts:99
Overwrites all guild-scoped application commands atomically.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
commands
Section titled “commands”readonly ApplicationCommandInput[]
Array of command data.
Returns
Section titled “Returns”Promise<APIApplicationCommand[]>
New full command list.