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


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

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

      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.
      The placeholder or null
    • getMinValues

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

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