Annotation Interface SelectMenuHandler


@Retention(RUNTIME) @Target(METHOD) public @interface SelectMenuHandler
Marks a method as a select menu handler.

Example:

@SelectMenuHandler("role-select")
public void handleRoleSelect(StringSelectInteractionEvent event) {
    String selected = event.getValues().get(0);
    event.reply("You selected: " + selected).setEphemeral(true).queue();
}

The value is the select menu ID prefix.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      the select menu ID prefix as a String