Discord.https - v3.0.16
    Preparing search index...

    Class SelectMenuOptionBuilder

    A builder that creates API-compatible JSON data for string select menu options.

    Implements

    Index

    Constructors

    • Creates a new string select menu option from API data.

      Parameters

      • Optionaldata: Partial<APISelectMenuOption>

        The API data to create this string select menu option with

      Returns SelectMenuOptionBuilder

      Creating a string select menu option from an API data object:

      const selectMenuOption = new SelectMenuOptionBuilder({
      label: 'catchy label',
      value: '1',
      });

      Creating a string select menu option using setters and API data:

      const selectMenuOption = new SelectMenuOptionBuilder({
      default: true,
      value: '1',
      })
      .setLabel('woah');

    Properties

    data: Partial<APISelectMenuOption>

    Methods

    • Sets whether this option is selected by default.

      Parameters

      • OptionalisDefault: boolean

        Whether this option is selected by default

      Returns this

    • Sets the description for this option.

      Parameters

      • description: string

        The description to use

      Returns this

    • Sets the label for this option.

      Parameters

      • label: string

        The label to use

      Returns this

    • Sets the value for this option.

      Parameters

      • value: string

        The value to use

      Returns this

    • Serializes this builder to API-compatible JSON data.

      Returns APISelectMenuOption

      This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.