Represents an application command.
Extends
BaseName | Constraints | Optional | Default | Description |
---|---|---|---|---|
PermissionsFetchType | Yes | {} | None |
Use contexts instead.
Deprecated
null
on guild commandsThe guild's id this command is part of, this may be non-null when
guild
is null
if the command was fetched from the ApplicationCommandManager
permissions:ApplicationCommandPermissionsManager<PermissionsFetchType, PermissionsFetchType, Guild | null, Snowflake>
The manager for permissions of this command on its guild or arbitrary guilds when the command is global
The type of this application command
Deletes this command.
Example
Edits this application command.
Example
Name | Type | Optional | Description |
---|---|---|---|
data | Partial<ApplicationCommandData> | No | The data to update the command with |
Whether this command equals another command. It compares all properties, so for most operations it is advisable to just compare
command.id === command2.id
as it is much faster and is often what most users need.Name | Type | Optional | Description |
---|---|---|---|
command | ApplicationCommand | ApplicationCommandData | RawApplicationCommandData | No | The command to compare with |
enforceOptionOrder | boolean | Yes | Whether to strictly check that options and choices are in the same order in the array The client may not always respect this ordering! |
Recursively checks that all options for an ApplicationCommand are equal to the provided options. In most cases it is better to compare using equals
Name | Type | Optional | Description |
---|---|---|---|
existing | readonly ApplicationCommandOption[] | No | The options on the existing command, should be options |
options | readonly ApplicationCommandOption[] | readonly ApplicationCommandOptionData[] | readonly APIApplicationCommandOption[] | No | The options to compare against |
enforceOptionOrder | boolean | Yes | Whether to strictly check that options and choices are in the same order in the array The client may not always respect this ordering! |
setDefaultMemberPermissions(defaultMemberPermissions):Promise<ApplicationCommand<PermissionsFetchType>>
Edits the default member permissions of this ApplicationCommand
Name | Type | Optional | Description |
---|---|---|---|
defaultMemberPermissions | PermissionResolvable | null | No | The default member permissions required to run this command |
Edits the description of this ApplicationCommand
Name | Type | Optional | Description |
---|---|---|---|
description | string | No | The new description of the command |
setDescriptionLocalizations(descriptionLocalizations):Promise<ApplicationCommand<PermissionsFetchType>>
Edits the localized descriptions of this ApplicationCommand
Example
Name | Type | Optional | Description |
---|---|---|---|
descriptionLocalizations | LocalizationMap | No | The new localized descriptions for the command |
Edits the DM permission of this ApplicationCommand
Name | Type | Optional | Description |
---|---|---|---|
dmPermission | boolean | Yes | Whether the command can be used in DMs |
Edits the name of this ApplicationCommand
Name | Type | Optional | Description |
---|---|---|---|
name | string | No | The new name of the command |
Edits the localized names of this ApplicationCommand
Example
Name | Type | Optional | Description |
---|---|---|---|
nameLocalizations | LocalizationMap | No | The new localized names for the command |
Edits the options of this ApplicationCommand
Name | Type | Optional | Description |
---|---|---|---|
options | readonly ApplicationCommandOptionData[] | No | The options to set for this command |