All Superinterfaces:
ActionComponent, Component, ItemComponent, SerializableData
All Known Subinterfaces:
EntitySelectMenu, StringSelectMenu

public interface SelectMenu extends ActionComponent
Represents a select menu in a message.
This is an interactive component and usually located within an ActionRow. One select menu fills up an entire action row by itself. You cannot have an action row with other components if a select menu is present in the same row.

The selections a user makes are only visible within their current client session. Other users cannot see the choices selected, and they will disappear when the client restarts or the message is reloaded.

This is a generic interface for all types of select menus.
You can use EntitySelectMenu.create(String, Collection) to create a select menu of Discord entities such as users.
Alternatively, you can use StringSelectMenu.create(String) to create a select menu of up to 25 pre-defined strings to pick from.

See Also:
  • Field Details

    • ID_MAX_LENGTH

      static final int ID_MAX_LENGTH
      The maximum length a select menu id can have
      See Also:
    • PLACEHOLDER_MAX_LENGTH

      static final int PLACEHOLDER_MAX_LENGTH
      The maximum length a select menu placeholder can have
      See Also:
    • OPTIONS_MAX_AMOUNT

      static final int OPTIONS_MAX_AMOUNT
      The maximum amount of options a select menu can have
      See Also:
  • Method Details

    • getPlaceholder

      @Nullable String getPlaceholder()
      Placeholder which is displayed when no selections have been made yet.
      Returns:
      The placeholder or null
    • getMinValues

      int getMinValues()
      The minimum amount of values a user has to select.
      Returns:
      The min values
    • getMaxValues

      int getMaxValues()
      The maximum amount of values a user can select at once.
      Returns:
      The max values
    • createCopy

      Creates a new preconfigured SelectMenu.Builder with the same settings used for this select menu.
      This can be useful to create an updated version of this menu without needing to rebuild it from scratch.
      Returns:
      The SelectMenu.Builder used to create the select menu