Hierarchy

  • StringSelectMenuBuilder
    • StringSelectMenuBuilder

Constructors

Properties

data: Partial<APIStringSelectComponent>

The API data associated with this component.

options: StringSelectMenuOptionBuilder[]

The options within this select menu.

Methods

  • Adds options to this select menu.

    Parameters

    • Rest...options: RestOrArray<SelectMenuComponentOptionData | StringSelectMenuOptionBuilder | APISelectMenuOption>

      The options to add

    Returns this

  • Sets the custom id for this select menu.

    Parameters

    • customId: string

      The custom id to use

    Returns this

  • Sets whether this select menu is disabled.

    Parameters

    • Optionaldisabled: boolean

      Whether this select menu is disabled

    Returns this

  • Parameters

    • execute: StringSelectMenuInteractionExecute

    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 options for this select menu.

    Parameters

    • Rest...options: RestOrArray<SelectMenuComponentOptionData | StringSelectMenuOptionBuilder | APISelectMenuOption>

      The options to set

    Returns this

  • Sets the placeholder for this select menu.

    Parameters

    • placeholder: string

      The placeholder to use

    Returns this

  • Removes, replaces, or inserts options for this select menu.

    Parameters

    • index: number

      The index to start at

    • deleteCount: number

      The number of options to remove

    • Rest...options: RestOrArray<StringSelectMenuOptionBuilder | APISelectMenuOption>

      The replacing option objects or builders

    Returns this

    This method behaves similarly to Array.prototype.splice(). It's useful for modifying and adjusting the order of existing options.

    Remove the first option:

    selectMenu.spliceOptions(0, 1);
    

    Remove the first n option:

    const n = 4;
    selectMenu.spliceOptions(0, n);

    Remove the last option:

    selectMenu.spliceOptions(-1, 1);
    
  • {@inheritDoc BaseSelectMenuBuilder.toJSON}

    Returns APIStringSelectComponent

  • Parameters

    • other: APIStringSelectComponent | JSONEncodable<APIStringSelectComponent>

    Returns StringSelectMenuBuilder