Class ReplyableEvent<T extends GenericInteractionCreateEvent>

java.lang.Object
com.github.kaktushose.jda.commands.dispatching.events.Event<T>
com.github.kaktushose.jda.commands.dispatching.events.ReplyableEvent<T>
All Implemented Interfaces:
Reply, ISnowflake, Interaction
Direct Known Subclasses:
ModalEvent, ModalReplyableEvent

public abstract sealed class ReplyableEvent<T extends GenericInteractionCreateEvent> extends Event<T> implements Reply permits ModalEvent, ModalReplyableEvent<T>

Subtype of Event that supports replying to the GenericInteractionCreateEvent with text messages.

You can either reply directly by using one of the reply methods, like reply(String), or you can call with() to use a ConfigurableReply to append components or override reply settings from the ReplyConfig.

Example:

public void onInteraction(ReplayableEvent<?> event) {
    event.reply("Hello World");
}
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • removeComponents

      public void removeComponents()

      Removes all components from the original message.

      The original message is the message, from which this event (interaction) originates. For example if this event is a ButtonEvent, the original message will be the message to which the pressed button is attached to.

    • getButton

      @NotNull public @NotNull Button getButton(@NotNull @NotNull String button)

      Gets a Button based on the method name and transforms it into a JDA Button.

      The button will be linked to the current Runtime. This may be useful if you want to send a component without using the framework.

      Parameters:
      button - the name of the button
      Returns:
      the JDA Button
    • getSelectMenu

      @NotNull public @NotNull SelectMenu getSelectMenu(@NotNull @NotNull String menu)

      Gets a StringSelectMenu or EntitySelectMenu based on the method name and transforms it into a JDA SelectMenu.

      The select menu will be linked to the current Runtime. This may be useful if you want to send a component without using the framework.

      Parameters:
      menu - the name of the select menu
      Returns:
      the JDA SelectMenu
    • with

      @NotNull public @NotNull ConfigurableReply with()

      Entry point for configuring a reply.

      Returns a new ConfigurableReply that can be used to append components or override reply settings.

      Returns:
      ConfigurableReply
    • reply

      @NotNull public @NotNull Message reply(@NotNull @NotNull String message)
      Description copied from interface: Reply
      Acknowledgement of this event with a text message.
      Specified by:
      reply in interface Reply
      Parameters:
      message - the message to send
      Returns:
      the Message that got created
    • reply

      @NotNull public @NotNull Message reply(@NotNull @NotNull MessageCreateData message)
      Description copied from interface: Reply
      Acknowledgement of this event with a text message.
      Specified by:
      reply in interface Reply
      Parameters:
      message - the MessageCreateData to send
      Returns:
      the Message that got created
    • reply

      @NotNull public @NotNull Message reply(@NotNull @NotNull EmbedBuilder builder)
      Description copied from interface: Reply
      Acknowledgement of this event with a text message.
      Specified by:
      reply in interface Reply
      Parameters:
      builder - the EmbedBuilder to send
      Returns:
      the Message that got created