Skip to main content

CreateApplicationCommand

Documentation


Documentation / @discordeno/types / CreateApplicationCommand

Interface: CreateApplicationCommand

Defined in: discordeno/interactions.ts:105

Properties

contexts?

optional contexts?: DiscordInteractionContextType[]

Defined in: discordeno/interactions.ts:157

Interaction context types where the command is available.

Remarks

This value is available only for globally-scoped commands.


defaultMemberPermissions?

optional defaultMemberPermissions?: string | null

Defined in: discordeno/interactions.ts:130

Set of permissions represented as a bit set


defaultPermission?

optional defaultPermission?: boolean

Defined in: discordeno/interactions.ts:142

Replaced by default_member_permissions and will be deprecated in the future. Indicates whether the command is enabled by default when the app is added to a guild.

Default

true

description?

optional description?: string

Defined in: discordeno/interactions.ts:119

1-100 character description


descriptionLocalizations?

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

Defined in: discordeno/interactions.ts:121

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


dmPermission?

optional dmPermission?: boolean | null

Defined in: discordeno/interactions.ts:136

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


handler?

optional handler?: DiscordInteractionEntryPointCommandHandlerType

Defined in: discordeno/interactions.ts:169

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).


integrationTypes?

optional integrationTypes?: DiscordApplicationIntegrationType[]

Defined in: discordeno/interactions.ts:150

Integration types 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: discordeno/interactions.ts:115

Name of command, 1-32 characters.

Remarks

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.


nameLocalizations?

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

Defined in: discordeno/interactions.ts:117

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


nsfw?

optional nsfw?: boolean

Defined in: discordeno/interactions.ts:161

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


options?

optional options?: object[]

Defined in: discordeno/interactions.ts:128

Parameters for the command

autocomplete?

optional autocomplete?: boolean

channelTypes?

optional channelTypes?: ChannelTypes[]

choices?

optional choices?: object[]

description

description: string

descriptionLocalizations?

optional descriptionLocalizations?: { bg?: string; cs?: string; da?: string; de?: string; el?: string; en-GB?: string; en-US?: string; es-419?: string; es-ES?: string; fi?: string; fr?: string; hi?: string; hr?: string; hu?: string; id?: string; it?: string; ja?: string; ko?: string; lt?: string; nl?: string; no?: string; pl?: string; pt-BR?: string; ro?: string; ru?: string; sv-SE?: string; th?: string; tr?: string; uk?: string; vi?: string; zh-CN?: string; zh-TW?: string; } | null

maxLength?

optional maxLength?: number

maxValue?

optional maxValue?: number

minLength?

optional minLength?: number

minValue?

optional minValue?: number

name

name: string

nameLocalizations?

optional nameLocalizations?: { bg?: string; cs?: string; da?: string; de?: string; el?: string; en-GB?: string; en-US?: string; es-419?: string; es-ES?: string; fi?: string; fr?: string; hi?: string; hr?: string; hu?: string; id?: string; it?: string; ja?: string; ko?: string; lt?: string; nl?: string; no?: string; pl?: string; pt-BR?: string; ro?: string; ru?: string; sv-SE?: string; th?: string; tr?: string; uk?: string; vi?: string; zh-CN?: string; zh-TW?: string; } | null

options?

optional options?: { type: ApplicationCommandOptionTypes; name: string; nameLocalizations?: { id?: string | undefined; da?: string | undefined; de?: string | undefined; ... 28 more ...; ko?: string | undefined; } | null | undefined; ... 10 more ...; autocomplete?: boolean | undefined; }[] | undefined

required?

optional required?: boolean

type

type: ApplicationCommandOptionTypes

Remarks

This is only valid in commands of type ChatInput


type?

optional type?: ApplicationCommandTypes

Defined in: discordeno/interactions.ts:159

Type of command, defaults ApplicationCommandTypes.ChatInput if not set