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:
@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
-
Optional Element Summary
-
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
-
minValue
int minValueThe 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 maxValueThe 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
-