Class ApplicationCommandOptionBuilder<T>

Type Parameters

Hierarchy

  • ApplicationCommandOptionBuilder

Constructors

Properties

autocomplete?: boolean
channelTypes?: ChannelTypes[]
description: string
descriptionLocalizations?: Record<string, string>
max?: number
min?: number
name: string
nameLocalizations?: Record<string, string>
required?: boolean
type: T

Methods

  • Add a choice.

    Parameters

    • name: string

      The name of the choice.

    • value: string | number

      The value of the choice.

    • Optional nameLocalizations: Record<string, string>

      A map of locales to name localizations.

    Returns ApplicationCommandOptionBuilder<T>

  • Add a description localization.

    Parameters

    • locale: string

      The locale of the localization.

    • description: string

      The localized description.

    Returns ApplicationCommandOptionBuilder<T>

  • Add a name localization.

    Parameters

    • locale: string

      The locale of the localization.

    • name: string

      The localized name.

    Returns ApplicationCommandOptionBuilder<T>

  • Toggle autocomplete for this option.

    Parameters

    • Optional value: boolean

    Returns ApplicationCommandOptionBuilder<T>

  • Set the description of this option.

    Parameters

    • description: string

    Returns ApplicationCommandOptionBuilder<T>

  • Set the description localizations of this option.

    Parameters

    • localizations: Record<string, string>

      A map of locales to localized description strings.

    Returns ApplicationCommandOptionBuilder<T>

  • Set the min/max for this option. This applied to both minValue/maxValue and minLength/maxLength.

    Parameters

    • Optional min: number
    • Optional max: number

    Returns ApplicationCommandOptionBuilder<T>

  • Set the name localizations of this option.

    Parameters

    • localizations: Record<string, string>

      A map of locales to localized name strings.

    Returns ApplicationCommandOptionBuilder<T>

  • Toggle this option being required.

    Parameters

    • Optional value: boolean

    Returns ApplicationCommandOptionBuilder<T>

  • Convert this command to JSON.

    Returns TypeToOption<T>

Generated using TypeDoc