Interface ActionComponent

All Superinterfaces:
Component, SerializableData
All Known Subinterfaces:
Button, SelectMenu

public interface ActionComponent extends Component
Component which supports interactions via ComponentInteraction.
  • Method Details

    • getId

      @Nullable String getId()
      The component ID or null.
      Some components such as link buttons don't have this.

      This need not be a numeric ID! All these component IDs are custom and not generated by Discord.

      Returns:
      The component ID or null if not present
    • isDisabled

      boolean isDisabled()
      Whether this action component is disabled.

      You can use asDisabled() or asEnabled() to create enabled/disabled instances.

      Returns:
      True, if this button is disabled
    • asDisabled

      Returns a copy of this component with isDisabled() set to true.
      Returns:
      New disabled component instance
    • asEnabled

      Returns a copy of this component with isDisabled() set to false.
      Returns:
      New enabled component instance
    • withDisabled

      @Nonnull @CheckReturnValue ActionComponent withDisabled(boolean disabled)
      Returns a copy of this component with isDisabled() set to the provided value.
      Parameters:
      disabled - True, if this component should be disabled
      Returns:
      New enabled/disabled component instance
      Throws:
      UnsupportedOperationException - If this component type cannot be disabled
    • getMaxPerRow

      default int getMaxPerRow()
      How many of these components can be added to one ActionRow.
      Returns:
      The maximum amount an action row can contain