ApplicationCommandManager

export class ApplicationCommandManager<
ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>,
PermissionsOptionsExtras = { guild: GuildResolvable },
PermissionsGuildType = null,
> extends CachedManager<Snowflake, ApplicationCommandScope, ApplicationCommandResolvable>
export class ApplicationCommandManager<
ApplicationCommandScope = ApplicationCommand<{ guild: GuildResolvable }>,
PermissionsOptionsExtras = { guild: GuildResolvable },
PermissionsGuildType = null,
> extends CachedManager<Snowflake, ApplicationCommandScope, ApplicationCommandResolvable>
Manages API methods for application commands and stores their cache.

Extends

CachedManager<Snowflake, ApplicationCommandScope, ApplicationCommandResolvable>
NameConstraintsOptionalDefaultDescription
ApplicationCommandScopeYesApplicationCommand<{ guild: GuildResolvable }>None
PermissionsOptionsExtrasYes{ guild: GuildResolvable }None
PermissionsGuildTypeYesnullNone
constructor(client, iterable?)
Constructs a new instance of the ApplicationCommandManager class
NameTypeOptionalDescription
clientClient<true>NoNone
iterableIterable<unknown>YesNone
Readonly
cache:Collection<K, Holds>
The cache of items for this manager.
Inherited from DataManager
Readonly
client:Client
The client that instantiated this Manager
Inherited from BaseManager
Readonly
holds:Constructable<Holds>
The data structure belonging to this manager.
Inherited from DataManager
permissions:ApplicationCommandPermissionsManager< { command?: ApplicationCommandResolvable } & PermissionsOptionsExtras, { command: ApplicationCommandResolvable } & PermissionsOptionsExtras, PermissionsGuildType, null >
The manager for permissions of arbitrary commands on arbitrary guilds
create(command, guildId?):Promise<ApplicationCommandScope>
Creates an application command.
NameTypeOptionalDescription
commandApplicationCommandDataResolvableNoThe command
guildIdSnowflakeYesThe guild's id to create this command in, ignored when using a GuildApplicationCommandManager
delete(command, guildId?):Promise<ApplicationCommandScope | null>
Deletes an application command.
NameTypeOptionalDescription
commandApplicationCommandResolvableNoThe command to delete
guildIdSnowflakeYesThe guild's id where the command is registered, ignored when using a GuildApplicationCommandManager
edit(command, data):Promise<ApplicationCommandScope>
Edits an application command.
NameTypeOptionalDescription
commandApplicationCommandResolvableNoThe command to edit
dataPartial<ApplicationCommandDataResolvable>NoThe data to update the command with
fetch(id, options):Promise<ApplicationCommand>
Obtains one or multiple application commands from Discord, or the cache if it's already available.
NameTypeOptionalDescription
idSnowflakeNoOptions for fetching application command(s)
optionsFetchApplicationCommandOptions & { guildId: Snowflake }NoAdditional options for this fetch
resolve(idOrInstance):Holds
Resolves a data entry to a data Object.
Returns
An instance from this Manager
NameTypeOptionalDescription
idOrInstanceHoldsNoThe id or instance of something in this Manager
resolveId(idOrInstance):K
Resolves a data entry to an instance id.
Returns
NameTypeOptionalDescription
idOrInstanceK | HoldsNoThe id or instance of something in this Manager
set(commands):Promise<Collection<Snowflake, ApplicationCommandScope>>
Sets all the commands for this application or guild.
NameTypeOptionalDescription
commandsreadonly ApplicationCommandDataResolvable[]NoThe commands
valueOf():Collection<K, Holds>