Annotation Interface Button


@Target(METHOD) @Retention(RUNTIME) public @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:

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:
  • Element Details

    • value

      String value
      Gets the label of the button.
      Returns:
      the label of the button
      Default:
      ""
    • style

      Gets the ButtonStyle.
      Returns:
      the ButtonStyle
      Default:
      PRIMARY
    • emoji

      String emoji
      Gets the Emoji of the button.
      Returns:
      the Emoji
      Default:
      ""
    • link

      String link
      Gets the link of the button.
      Returns:
      the link of the button
      Default:
      ""