-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Description
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.
MrGraversen