Annotation Interface StringSelectMenu


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

Methods annotated with StringSelectMenu will be registered as a StringSelectMenu 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 a string select menu by calling ConfigurableReply.components(Component...).

Example:

@SelectOption(label= "Pizza", value = "pizza")
@SelectOption(label= "Hamburger", value = "hamburger")
@SelectOption(label= "Sushi", value = "Sushi")
@StringSelectMenu("What's your favourite food?")
public void onMenu(ComponentEvent event, List<String> choices) { ... }
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Configure the placeholder which is displayed when no selections have been made yet.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    The maximum amount of values a user can select.
    int
    The minimum amount of values a user has to select.
  • Element Details

    • value

      String value
      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
    • 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