Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
MinnDevelopment opened this issue Oct 3, 2021 · 3 comments
Open

Comments

@MinnDevelopment
Copy link
Owner

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.

@Cardistymo
Copy link

Are there any plans to implement this soon? I saw there was a pr but it got closed...

@MrGraversen
Copy link

MrGraversen commented Jun 2, 2022

Would love for this to be introduced. @RohanGoyalDev, what happened with #56?

@loicmdf
Copy link

loicmdf commented Mar 12, 2023

is this happening any time soon ?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
4 participants