Search...

SlashCommandBooleanOption

export declare class SlashCommandBooleanOption extends ApplicationCommandOptionBase 
export declare class SlashCommandBooleanOption extends ApplicationCommandOptionBase 
A slash command boolean option.
Readonly
Optional

description_localizations?

:

LocalizationMap

The description localizations of this command.
Inherited from SharedNameAndDescription
Readonly

description

:

string

The description of this command.
Inherited from SharedNameAndDescription
Readonly
Optional

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
Readonly

type

:

ApplicationCommandOptionType.Boolean

The type of this option.
Protected

runRequiredValidations()

:

void

This method runs required validators on this builder.
Inherited from ApplicationCommandOptionBase

setDescription(description)

:

this

Sets the description of this command.
NameTypeOptionalDescription
descriptionstringNoThe description to use
Inherited from SharedNameAndDescription

setDescriptionLocalization(locale, localizedDescription)

:

this

Sets a description localization for this command.
NameTypeOptionalDescription
localeLocaleStringNoThe locale to set
localizedDescriptionstring | nullNoThe localized description for the given locale
Inherited from SharedNameAndDescription

setDescriptionLocalizations(localizedDescriptions)

:

this

Sets the description localizations for this command.
NameTypeOptionalDescription
localizedDescriptionsLocalizationMap | nullNoThe object of localized descriptions to set
Inherited from SharedNameAndDescription

setName(name)

:

this

Sets the name of this command.
NameTypeOptionalDescription
namestringNoThe name to use
Inherited from SharedNameAndDescription

setNameLocalization(locale, localizedName)

:

this

SSets a name localization for this command.
NameTypeOptionalDescription
localeLocaleStringNoThe locale to set
localizedNamestring | nullNoThe localized name for the given locale
Inherited from SharedNameAndDescription

setNameLocalizations(localizedNames)

:

this

Sets the name localizations for this command.
NameTypeOptionalDescription
localizedNamesLocalizationMap | nullNoThe object of localized names to set
Inherited from SharedNameAndDescription

setRequired(required)

:

this

Sets whether this option is required.
NameTypeOptionalDescription
requiredbooleanNoWhether this option should be required
Inherited from ApplicationCommandOptionBase

toJSON()

:

APIApplicationCommandBooleanOption

Serializes this builder to API-compatible JSON data.
Remarks
This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.