Interface IButtonHandler


@ReleasedSince("26.5.123") public interface IButtonHandler
Represents a handler for a specific Discord Button interaction. Implement this interface to define the behavior when a user clicks a custom button.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the specific logic when the associated button is clicked.
    @NotNull Button
    Gets the Discord Button component associated with this handler.
  • Method Details

    • getButton

      @NotNull @NotNull Button getButton()
      Gets the Discord Button component associated with this handler.
      Returns:
      The configured Button instance.
    • execute

      void execute(ButtonInteractionEvent event)
      Executes the specific logic when the associated button is clicked.
      Parameters:
      event - The ButtonInteractionEvent triggered by the user.