Skip to main content

DiscordApplicationCommandOption

@discordeno/bot


Documentation / @discordeno/bot / DiscordApplicationCommandOption

Interface: DiscordApplicationCommandOption

Defined in: packages/types/dist/types/discord.d.ts:2496

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.d.ts:2549

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.d.ts:2556

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.d.ts:2533

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.d.ts:2515

1-100 character description


description_localizations?

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

Defined in: packages/types/dist/types/discord.d.ts:2517

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.d.ts:2584

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.d.ts:2570

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.d.ts:2577

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.d.ts:2563

The minimum permitted value

Remarks

Only valid in options of type Integer or Number


name

name: string

Defined in: packages/types/dist/types/discord.d.ts:2511

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.d.ts:2513

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


options?

optional options: DiscordApplicationCommandOption[]

Defined in: packages/types/dist/types/discord.d.ts:2540

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.d.ts:2524

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.d.ts:2498

Type of option