Interface Component

All Superinterfaces:
SerializableData
All Known Subinterfaces:
ActionComponent, Button, EntitySelectMenu, ItemComponent, LayoutComponent, SelectMenu, StringSelectMenu, TextInput
All Known Implementing Classes:
ActionRow

public interface Component extends SerializableData
Component of a Message or Modal.
These are used to extend messages with interactive elements such as buttons or select menus. Components are also the primary building blocks for Modals.

Not every component can be used in Messages or Modals. Use Component.Type.isMessageCompatible() and Component.Type.isModalCompatible() to check whether a component can be used.

See Also:
  • Method Details

    • getType

      The type of component.
      Returns:
      Component.Type
    • isMessageCompatible

      boolean isMessageCompatible()
      Whether this Component is compatible with Messages.
      If the component in question is a LayoutComponent, this also checks every component inside it.
      Returns:
      True, if this Component is compatible with messages.
    • isModalCompatible

      boolean isModalCompatible()
      Whether this Component is compatible with Modals.
      If the component in question is a LayoutComponent, this also checks every component inside it.
      Returns:
      True, if this Component is compatible with modals.