Annotation Interface EntityMenu


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

Methods annotated with EntityMenu will be registered as an 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:

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

Example:

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

    • value

    • 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

      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
    • uniqueId

      int uniqueId
      The uniqueId of this component. Must be greater than 0. Default value is -1 which will result in Discord auto assigning an id.
      Default:
      -1
    • required

      boolean required

      Configure whether the user must populate this select menu if inside a Modal.

      This defaults to true in Modals when unset.

      This attribute is completely separate from the value range, for example, you can have an optional select menu with the range set to [2 ; 5], meaning you accept either 0 options, or, at least 2 but at most 5.

      This only has an effect in Modals!

      Returns:
      Whether this menu is required
      Default:
      true