Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SelectMenuBuilder

Represents a validated button component

Hierarchy

  • SelectMenuBuilder

Index

Constructors

Properties

Accessors

  • get customId(): string
  • The custom Id of this button

    Returns string

  • get disabled(): undefined | boolean
  • Whether this select menu is disabled

    Returns undefined | boolean

  • get maxValues(): undefined | number
  • The maximum number of items that can be chosen; max 25

    Returns undefined | number

  • get minValues(): undefined | number
  • The minimum number of items that must be chosen; min 0, max 25

    Returns undefined | number

  • get placeholder(): undefined | string
  • Custom placeholder text if nothing is selected, max 150 characters

    Returns undefined | string

  • The type of this component

    Returns SelectMenu

Methods

  • Adds an option to this select menu

    example
    selectMenu.addOptions(new SelectMenuOptionBuilder('option1', 'Option 1', '🍕'));
    
    example
    // Add multiple options
    selectMenu.addOptions(
    new SelectMenuOptionBuilder('option1', 'Option 1', '🍕'),
    new SelectMenuOptionBuilder('option2', 'Option 2', '🍔')
    )

    Parameters

    Returns SelectMenuBuilder

  • Sets the custom Id of this select menu

    example
    selectMenu.setCustomId('first_menu');
    

    Parameters

    • id: string

    Returns SelectMenuBuilder

  • Sets the disabled state of this select menu

    example
    selectMenu.setDisabled(true);
    

    Parameters

    • disabled: boolean = true

    Returns SelectMenuBuilder

  • Sets the maximum number of items that can be chosen; max 25

    Parameters

    • max: number = 0

    Returns SelectMenuBuilder

  • Sets the minimum number of items that must be chosen; min 0, max 25

    Parameters

    • min: number = 0

    Returns SelectMenuBuilder

  • Sets the options of this select menu

    example
    selectMenu.setOptions(new SelectMenuOptionBuilder('option1', 'Option 1', '🍕'));
    
    example
    // Set multiple options
    selectMenu.setOptions(
    new SelectMenuOptionBuilder('option1', 'Option 1', '🍕'),
    new SelectMenuOptionBuilder('option2', 'Option 2', '🍔')
    )

    Parameters

    Returns SelectMenuBuilder

  • Sets the placeholder of this select menu

    example
    selectMenu.setPlaceholder('click here to select an option');
    

    Parameters

    • Optional id: string

    Returns SelectMenuBuilder

  • Returns the raw data of this select menu

    Returns APISelectMenuComponent

Generated using TypeDoc version 0.22.16, the 9/16/2022 at 1:09:15 AM