Interface Component
- All Superinterfaces:
SerializableData
- All Known Subinterfaces:
ActionComponent
,Button
,EntitySelectMenu
,ItemComponent
,LayoutComponent
,SelectMenu
,StringSelectMenu
,TextInput
- All Known Implementing Classes:
ActionRow
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
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:
-
Nested Class Summary
-
Method Summary
Methods inherited from interface net.dv8tion.jda.api.utils.data.SerializableData
toData
-
Method Details
-
getType
The type of component.- Returns:
Component.Type
-
isMessageCompatible
boolean isMessageCompatible()Whether this Component is compatible withMessages
.
If the component in question is aLayoutComponent
, this also checks every component inside it.- Returns:
- True, if this Component is compatible with messages.
-
isModalCompatible
boolean isModalCompatible()Whether this Component is compatible withModals
.
If the component in question is aLayoutComponent
, this also checks every component inside it.- Returns:
- True, if this Component is compatible with modals.
-