Annotation 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:
- First parameter must be of type
ComponentEvent - Second parameter must be of type
List<String>
You can reply with a string select menu by calling ConfigurableReply.components(Component...).
Example:
@MenuOption(label= "Pizza", value = "pizza")
@MenuOption(label= "Hamburger", value = "hamburger")
@MenuOption(label= "Sushi", value = "Sushi")
@StringSelectMenu("What's your favourite food?")
public void onMenu(ComponentEvent event, List<String> choices) { ... }
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueConfigure 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 minValueThe minimum amount of values a user has to select.
Default:
1The minimum must not exceed the amount of available options.
- Returns:
- the minimum amount of values a user has to select
- Default:
1
-
maxValue
int maxValueThe maximum amount of values a user can select.
Default:
1The maximum must not exceed the amount of available options.
- Returns:
- the maximum amount of values a user can select
- Default:
1
-