Package discord4j.core.object.component
Class MessageComponent
java.lang.Object
discord4j.core.object.component.MessageComponent
- Direct Known Subclasses:
ActionComponent
,LayoutComponent
A Discord message component.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MessageComponent
fromData
(discord4j.discordjson.json.ComponentData data) Constructs aMessageComponent
from raw data.discord4j.discordjson.json.ComponentData
getData()
Gets the data of the component.getType()
Gets the type of the component.
-
Method Details
-
fromData
Constructs aMessageComponent
from raw data.The correct subtype will be chosen based on the component's
MessageComponent.Type
.- Parameters:
data
- The raw component data.- Returns:
- A component with the given data.
-
getData
public discord4j.discordjson.json.ComponentData getData()Gets the data of the component.- Returns:
- The data of the component.
-
getType
Gets the type of the component.- Returns:
- The type of the component.
-