discord-webhooks
discord-webhooks copied to clipboard
Support for component types such as buttons and select menus
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.
Are there any plans to implement this soon? I saw there was a pr but it got closed...
Would love for this to be introduced. @RohanGoyalDev, what happened with #56?
is this happening any time soon ?