Skip to main content

DiscordApplicationCommand

Documentation


Documentation / @discordeno/types / DiscordApplicationCommand

Interface: DiscordApplicationCommand

Defined in: discord/interactions.ts:286

https://docs.discord.com/developers/interactions/application-commands#application-command-object-application-command-structure

Properties

application_id

application_id: string

Defined in: discord/interactions.ts:292

ID of the parent application


contexts?

optional contexts?: DiscordInteractionContextType[] | null

Defined in: discord/interactions.ts:344

Interaction context(s) where the command can be used

Remarks

This value is available only for globally-scoped commands.


default_member_permissions

default_member_permissions: string | null

Defined in: discord/interactions.ts:312

Set of permissions represented as a bit set


default_permission?

optional default_permission?: boolean

Defined in: discord/interactions.ts:327

Indicates whether the command is enabled by default when the app is added to a guild

Remarks

Not recommended for use as field will soon be deprecated

Default

true

description

description: string

Defined in: discord/interactions.ts:306

Description for ApplicationCommandTypes.ChatInput commands, 1-100 characters.


description_localizations?

optional description_localizations?: Partial<Record<Locales, string>> | null

Defined in: discord/interactions.ts:308

Localization object for description field. Values follow the same restrictions as description


dm_permission?

optional dm_permission?: boolean

Defined in: discord/interactions.ts:318

Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible.

Deprecated

use contexts instead


guild_id?

optional guild_id?: string

Defined in: discord/interactions.ts:294

Guild id of the command, if not global


handler?

optional handler?: DiscordInteractionEntryPointCommandHandlerType

Defined in: discord/interactions.ts:353

Determines whether the interaction is handled by the app's interactions handler or by Discord

Remarks

This can only be set for application commands of type PRIMARY_ENTRY_POINT for applications with the EMBEDDED flag (i.e. applications that have an Activity).


id

id: string

Defined in: discord/interactions.ts:288

Unique ID of command


integration_types?

optional integration_types?: DiscordApplicationIntegrationType[]

Defined in: discord/interactions.ts:337

Installation contexts where the command is available

Remarks

This value is available only for globally-scoped commands Defaults to the application configured contexts


name

name: string

Defined in: discord/interactions.ts:302

Name of command, 1-32 characters. ApplicationCommandTypes.ChatInput command names must match the following regex ^[-_ʼ\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$ with the unicode flag set. If there is a lowercase variant of any letters used, you must use those. Characters with no lowercase variants and/or uncased letters are still allowed. ApplicationCommandTypes.UserandApplicationCommandTypes.Message` commands may be mixed case and can include spaces.


name_localizations?

optional name_localizations?: Partial<Record<Locales, string>> | null

Defined in: discord/interactions.ts:304

Localization object for name field. Values follow the same restrictions as name


nsfw?

optional nsfw?: boolean

Defined in: discord/interactions.ts:329

Indicates whether the command is age-restricted, defaults to false


options?

optional options?: DiscordApplicationCommandOption[]

Defined in: discord/interactions.ts:310

Parameters for the command, max of 25


type?

optional type?: ApplicationCommandTypes

Defined in: discord/interactions.ts:290

Type of command, defaults to ApplicationCommandTypes.ChatInput


version

version: string

Defined in: discord/interactions.ts:346

Auto incrementing version identifier updated during substantial record changes