Annotation Interface EntitySelectMenu


@Target(METHOD) @Retention(RUNTIME) public @interface EntitySelectMenu

Methods annotated with EntitySelectMenu will be registered as a EntitySelectMenu at startup.

Therefore, the method must be declared inside a class that is annotated with Interaction. Furthermore, the method signature has to meet the following conditions:

  • First parameter must be of type ComponentEvent
  • Second parameter must be of type Mentions

You can reply with an entity select menu by calling ConfigurableReply.components(Component...).

Example:

@EntitySelectMenu(value = SelectTarget.USER, placeholder = "Who's your favourite user?")
public void onMenu(ComponentEvent event, Mentions mentions) { ... }
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.SelectTarget[]
    Supported EntitySelectMenu.SelectTargets.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    net.dv8tion.jda.api.entities.channel.ChannelType[]
    The ChannelTypes that should be supported by this menu.
    long[]
    The default values for channels that will be shown to the user.
    long[]
    The default values for roles that will be shown to the user.
    long[]
    The default values for users that will be shown to the user.
    int
    The maximum amount of values a user can select.
    int
    The minimum amount of values a user has to select.
    Configure the placeholder which is displayed when no selections have been made yet.
  • Element Details

    • value

      net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.SelectTarget[] value
      Supported EntitySelectMenu.SelectTargets.
      Returns:
      an array of supported EntitySelectMenu.SelectTargets
    • defaultRoles

      long[] defaultRoles
      The default values for roles that will be shown to the user.
      Returns:
      the default values
      Default:
      {-1L}
    • defaultChannels

      long[] defaultChannels
      The default values for channels that will be shown to the user.
      Returns:
      the default values
      Default:
      {-1L}
    • defaultUsers

      long[] defaultUsers
      The default values for users that will be shown to the user.
      Returns:
      the default values
      Default:
      {-1L}
    • channelTypes

      net.dv8tion.jda.api.entities.channel.ChannelType[] channelTypes
      The ChannelTypes that should be supported by this menu. This is only relevant for menus that allow CHANNEL targets.
      Returns:
      the ChannelTypes that should be supported by this menu
      Default:
      {UNKNOWN}
    • placeholder

      String placeholder
      Configure the placeholder which is displayed when no selections have been made yet.
      Returns:
      the placeholder which is displayed when no selections have been made yet
      Default:
      ""
    • minValue

      int minValue

      The minimum amount of values a user has to select.

      Default: 1

      The minimum must not exceed the amount of available options.

      Returns:
      the minimum amount of values a user has to select
      Default:
      1
    • maxValue

      int maxValue

      The maximum amount of values a user can select.

      Default: 1

      The maximum must not exceed the amount of available options.

      Returns:
      the maximum amount of values a user can select
      Default:
      1