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:
  • Method Details

    • fromData

      public static MessageComponent fromData(discord4j.discordjson.json.ComponentData data)
      Constructs a MessageComponent 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.