Skip to main content

DiscordApplicationCommandOption

@discordeno/bot


Documentation / @discordeno/bot / DiscordApplicationCommandOption

Interface: DiscordApplicationCommandOption

Defined in: packages/types/dist/types/discord/interactions.d.ts:242

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

Properties

autocomplete?

optional autocomplete: boolean

Defined in: packages/types/dist/types/discord/interactions.d.ts:295

If autocomplete interactions are enabled for this option.

Remarks

Only valid in options of type String, Integer, or Number

When choices are provided, this may not be set to true


channel_types?

optional channel_types: ChannelTypes[]

Defined in: packages/types/dist/types/discord/interactions.d.ts:302

The channels shown will be restricted to these types

Remarks

Only valid in option of type Channel


choices?

optional choices: DiscordApplicationCommandOptionChoice[]

Defined in: packages/types/dist/types/discord/interactions.d.ts:279

Choices for the option from which the user can choose, max 25

Remarks

Only valid in options of type String, Integer, or Number

If you provide an array of choices, they will be the ONLY accepted values for this option


description

description: string

Defined in: packages/types/dist/types/discord/interactions.d.ts:261

1-100 character description


description_localizations?

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

Defined in: packages/types/dist/types/discord/interactions.d.ts:263

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


max_length?

optional max_length: number

Defined in: packages/types/dist/types/discord/interactions.d.ts:330

The maximum permitted length, should be in the range of from 0 to 600

Remarks

Only valid in options of type String


max_value?

optional max_value: number

Defined in: packages/types/dist/types/discord/interactions.d.ts:316

The maximum permitted value

Remarks

Only valid in options of type Integer or Number


min_length?

optional min_length: number

Defined in: packages/types/dist/types/discord/interactions.d.ts:323

The minimum permitted length, should be in the range of from 0 to 600

Remarks

Only valid in options of type String


min_value?

optional min_value: number

Defined in: packages/types/dist/types/discord/interactions.d.ts:309

The minimum permitted value

Remarks

Only valid in options of type Integer or Number


name

name: string

Defined in: packages/types/dist/types/discord/interactions.d.ts:257

Name of command, 1-32 characters.

Remarks

This value should be unique within an array of DiscordApplicationCommandOption

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.

User and Message commands may be mixed case and can include spaces.


name_localizations?

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

Defined in: packages/types/dist/types/discord/interactions.d.ts:259

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


options?

optional options: DiscordApplicationCommandOption[]

Defined in: packages/types/dist/types/discord/interactions.d.ts:286

If the option is a subcommand or subcommand group type, these nested options will be the parameters

Remarks

Only valid in option of type SubCommand or SubCommandGroup


required?

optional required: boolean

Defined in: packages/types/dist/types/discord/interactions.d.ts:270

If the parameter is required or optional. default false

Remarks

Valid in all option types except SubCommand and SubCommandGroup


type

type: ApplicationCommandOptionTypes

Defined in: packages/types/dist/types/discord/interactions.d.ts:244

Type of option