Package discord4j.core.object.component
Class MessageComponent
- java.lang.Object
-
- discord4j.core.object.component.MessageComponent
-
- Direct Known Subclasses:
ActionComponent
,LayoutComponent
public class MessageComponent extends Object
A Discord message component.- See Also:
- Message Components
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MessageComponent.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessageComponent
fromData(discord4j.discordjson.json.ComponentData data)
Constructs aMessageComponent
from raw data.discord4j.discordjson.json.ComponentData
getData()
Gets the data of the component.MessageComponent.Type
getType()
Gets the type of the component.
-
-
-
Method Detail
-
fromData
public static MessageComponent fromData(discord4j.discordjson.json.ComponentData data)
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
public MessageComponent.Type getType()
Gets the type of the component.- Returns:
- The type of the component.
-
-