Class ReplyableEvent<T extends net.dv8tion.jda.api.events.interaction.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, net.dv8tion.jda.api.entities.ISnowflake, net.dv8tion.jda.api.interactions.Interaction
Direct Known Subclasses:
ModalEvent, ModalReplyableEvent

public abstract sealed class ReplyableEvent<T extends net.dv8tion.jda.api.events.interaction.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 net.dv8tion.jda.api.interactions.components.buttons.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 defining method
      Returns:
      the JDA Button
    • getButton

      @NotNull public @NotNull net.dv8tion.jda.api.interactions.components.buttons.Button getButton(@NotNull @NotNull Class<?> origin, @NotNull @NotNull String button)

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

      The button will be runtime-independent. This may be useful if you want to send a component without using the framework.

      Parameters:
      origin - the Class of the method
      button - the name of the button defining method
      Returns:
      the JDA Button
    • getSelectMenu

      @NotNull public @NotNull net.dv8tion.jda.api.interactions.components.selections.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
    • getSelectMenu

      @NotNull public @NotNull net.dv8tion.jda.api.interactions.components.selections.SelectMenu getSelectMenu(@NotNull @NotNull Class<?> origin, @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 runtime-independent. This may be useful if you want to send a component without using the framework.

      Parameters:
      origin - the Class of the method
      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:
      a new ConfigurableReply
      See Also:
    • reply

      @NotNull public @NotNull net.dv8tion.jda.api.entities.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 net.dv8tion.jda.api.entities.Message reply(@NotNull @NotNull net.dv8tion.jda.api.utils.messages.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 net.dv8tion.jda.api.entities.Message reply(@NotNull @NotNull net.dv8tion.jda.api.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