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

    Class UserSelectMenuBuilder

    A builder that creates API-compatible JSON data for user select menus.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new select menu from API data.

      Parameters

      Returns UserSelectMenuBuilder

      Creating a select menu from an API data object:

      const selectMenu = new UserSelectMenuBuilder({
      custom_id: 'a cool select menu',
      placeholder: 'select an option',
      max_values: 2,
      });

      Creating a select menu using setters and API data:

      const selectMenu = new UserSelectMenuBuilder({
      custom_id: 'a cool select menu',
      })
      .setMinValues(1);

    Properties

    data: Partial<DataType>

    The API data associated with this component.

    Methods

    • Adds default users to this auto populated select menu.

      Parameters

      Returns this

    • Clears the id of this component, defaulting to a default incremented id.

      Returns this

    • Sets the custom id for this select menu.

      Parameters

      • customId: string

        The custom id to use

      Returns this

    • Sets default users for this auto populated select menu.

      Parameters

      Returns this

    • Sets whether this select menu is disabled.

      Parameters

      • Optionaldisabled: boolean

        Whether this select menu is disabled

      Returns this

    • Sets the id (not the custom id) for this component.

      Parameters

      • id: number

        The id for this component

      Returns this

    • Sets the maximum values that must be selected in the select menu.

      Parameters

      • maxValues: number

        The maximum values that must be selected

      Returns this

    • Sets the minimum values that must be selected in the select menu.

      Parameters

      • minValues: number

        The minimum values that must be selected

      Returns this

    • Sets the placeholder for this select menu.

      Parameters

      • placeholder: string

        The placeholder to use

      Returns this

    • Sets whether this select menu is required.

      Parameters

      • Optionalrequired: boolean

        Whether this select menu is required

      Returns this

      Only for use in modals.