Annotation Interface Button
Methods annotated with Button
will be registered as a button 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
You can reply with a button by calling ConfigurableReply.components(Component...)
.
Example:
@Button(value = "Press me", style = ButtonStyle.DANGER)
public void onButton(ComponentEvent event) { ... }
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionGets theEmoji
of the button.Gets the link of the button.Gets theButtonStyle
.Gets the label of the button.
-
Element Details
-
value
-
style
-
emoji
-
link
-