Skip to content

Support for component types such as buttons and select menus #46

@MinnDevelopment

Description

@MinnDevelopment

Since this library can be used to handle interaction webhooks, it should also support message components. This would need to be added to WebhookMessage and WebhookMessageBuilder. For more details on components, read up here: Message Components.

A possible implementation could look like this:

ActionRow buttons = ActionRow.of(
  Button.primary("custom_id", "Label")
);

WebhookMessage message = new WebookMessageBuilder()
  .addComponents(buttons)
  .build();

ActionRow would be an implementation of LayoutComponent and Button would be an ActionComponent.

interface Component extends JSONString {
  int getType();
}

interface LayoutComponent extends Component {
  List<ActionComponent> getComponents();
}

interface ActionComponent extends Component {
  String getCustomId();
}

Since this library only handles incoming webhooks, events and similar cannot be supported. I'm only looking for the support of sending message components in webhook messages.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions