Skip to main content
Latest
interface DiscordApplicationCommandOption
Re-export
import { type DiscordApplicationCommandOption } from "https://deno.land/x/discordeno@18.0.1/mod.ts";

Properties

type: ApplicationCommandOptionTypes

Type of option

name: string

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.

optional
name_localizations: Localization | null

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

description: string

1-100 character description

optional
description_localizations: Localization | null

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

optional
required: boolean

If the parameter is required or optional--default false

optional
choices: DiscordApplicationCommandOptionChoice[]

Choices for the option types ApplicationCommandOptionTypes.String, ApplicationCommandOptionTypes.Integer, and ApplicationCommandOptionTypes.Number, from which the user can choose, max 25

optional
options: DiscordApplicationCommandOption[]

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

optional
autocomplete: boolean

If autocomplete interactions are enabled for this option.

Only available for ApplicationCommandOptionTypes.String, ApplicationCommandOptionTypes.Integer and ApplicationCommandOptionTypes.Number option types

optional
channel_types: ChannelTypes[]

If the option is a channel type, the channels shown will be restricted to these types

optional
min_value: number

If the option type is ApplicationCommandOptionTypes.Integer or ApplicationCommandOptionTypes.Number, the minimum permitted value

optional
max_value: number

If the option type is ApplicationCommandOptionTypes.Integer or ApplicationCommandOptionTypes.Number, the maximum permitted value

optional
min_length: number

If the option type is ApplicationCommandOptionTypes.String, the minimum permitted length

optional
max_length: number

If the option type is ApplicationCommandOptionTypes.String, the maximum permitted length