Preview environment

class SlashCommandStringOption

export declare class SlashCommandStringOption extends ApplicationCommandOptionBase

A slash command string option.

readonlyoptional
description_localizations? : LocalizationMap

The description localizations of this command.

Inherited from: SharedNameAndDescription

readonly
description : string

The description of this command.

Inherited from: SharedNameAndDescription

readonlyoptional
max_length? : number

The maximum length of this option.

readonlyoptional
min_length? : number

The minimum length of this option.

readonlyoptional
name_localizations? : LocalizationMap

The name localizations of this command.

Inherited from: SharedNameAndDescription

readonly
name : string

The name of this command.

Inherited from: SharedNameAndDescription

readonly
required : boolean

Whether this option is required.

Inherited from: ApplicationCommandOptionBase

The type of this option.

readonlyoptional
autocomplete? : boolean

Whether this option utilizes autocomplete.

Inherited from: ApplicationCommandOptionWithAutocompleteMixin

readonlyoptional
choices? : APIApplicationCommandOptionChoice<ChoiceType>[]

The choices of this option.

Inherited from: ApplicationCommandOptionWithChoicesMixin

protected
runRequiredValidations() : void

This method runs required validators on this builder.

Inherited from: ApplicationCommandOptionBase

setDescription(
description: string
) : this

Sets the description of this command.

Inherited from: SharedNameAndDescription

setDescriptionLocalization(
locale: LocaleString
localizedDescription: string | null
) : this

Sets a description localization for this command.

Inherited from: SharedNameAndDescription

setDescriptionLocalizations(
localizedDescriptions: LocalizationMap | null
) : this

Sets the description localizations for this command.

Inherited from: SharedNameAndDescription

setMaxLength(
max: number
) : this

Sets the maximum length of this string option.

setMinLength(
min: number
) : this

Sets the minimum length of this string option.

setName(
name: string
) : this

Sets the name of this command.

Inherited from: SharedNameAndDescription

setNameLocalization(
locale: LocaleString
localizedName: string | null
) : this

Sets a name localization for this command.

Inherited from: SharedNameAndDescription

setNameLocalizations(
localizedNames: LocalizationMap | null
) : this

Sets the name localizations for this command.

Inherited from: SharedNameAndDescription

setRequired(
required: boolean
) : this

Sets whether this option is required.

Inherited from: ApplicationCommandOptionBase

Serializes this builder to API-compatible JSON data.

addChoices() : this

Adds multiple choices to this option.

Inherited from: ApplicationCommandOptionWithChoicesMixin

setAutocomplete(
autocomplete: boolean
) : this

Whether this option uses autocomplete.

Inherited from: ApplicationCommandOptionWithAutocompleteMixin

setChoices<

Input extends APIApplicationCommandOptionChoice<ChoiceType>

>(
...choices: RestOrArray<Input>
) : this

Sets multiple choices for this option.

Inherited from: ApplicationCommandOptionWithChoicesMixin