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 MessageReply.components(Component...).
Example:
@Button(value = "Press me", style = ButtonStyle.DANGER)
public void onButton(ComponentEvent event) { ... }
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
-
style
-
emoji
-
link
-
uniqueId
int uniqueIdThe uniqueId of this component. Must be greater than 0. Default value is-1which will result in Discord auto assigning an id.- Default:
-1
-