Class CommandEvent

java.lang.Object
io.github.kaktushose.jdac.dispatching.events.Event<net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent>
io.github.kaktushose.jdac.dispatching.events.ReplyableEvent<net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent>
io.github.kaktushose.jdac.dispatching.events.ModalReplyableEvent<net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent>
io.github.kaktushose.jdac.dispatching.events.interactions.CommandEvent
All Implemented Interfaces:
net.dv8tion.jda.api.entities.ISnowflake, net.dv8tion.jda.api.interactions.Interaction

public final class CommandEvent extends ModalReplyableEvent<net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent>
This class is a subclass of Event. It provides additional features for replying to a GenericCommandInteractionEvent.
See Also:
  • Constructor Details

    • CommandEvent

      public CommandEvent()
  • Method Details

    • jdaEvent

      public <T extends net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent> T jdaEvent(Class<T> type)
      Returns the underlying GenericCommandInteractionEvent and casts it to the given type.
      Type Parameters:
      T - a subtype of GenericCommandInteractionEvent
      Parameters:
      type - a subtype of GenericCommandInteractionEvent, like SlashCommandInteractionEvent
      Returns:
      T the event
    • deferReply

      public void deferReply(boolean ephemeral)
      Description copied from class: ReplyableEvent

      Acknowledge this interaction and defer the reply to a later time.

      This will send a <Bot> is thinking... message in chat that will be updated later. This will use the passed boolean to set the ephemeral flag. If your initial deferred message is ephemeral it cannot be made non-ephemeral later. Use ReplyableEvent.deferReply() to use the InteractionDefinition.ReplyConfig for the ephemeral flag.

      You only have 3 seconds to acknowledge an interaction!

      When the acknowledgement is sent after the interaction expired, you will receive ErrorResponse.UNKNOWN_INTERACTION.

      Use ReplyableEvent.reply(String, Entry...) to reply directly.

      Specified by:
      deferReply in class ReplyableEvent<net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent>
      Parameters:
      ephemeral - yes