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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeferReply(boolean ephemeral) Acknowledge this interaction and defer the reply to a later time.<T extends net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent>
TReturns the underlyingGenericCommandInteractionEventand casts it to the given type.Methods inherited from class ModalReplyableEvent
replyModal, replyModal, replyModal, replyModalMethods inherited from class ReplyableEvent
deferReply, embed, findEmbed, getButton, getButton, getSelectMenu, getSelectMenu, reply, reply, reply, reply, reply, withMethods inherited from class Event
closeRuntime, getChannel, getChannelIdLong, getContext, getEntitlements, getGuild, getIdLong, getIntegrationOwners, getJDA, getMember, getToken, getTypeRaw, getUser, getUserLocale, interactionInstance, introspection, isAcknowledged, jdaEvent, kv, messageResolver, resolve, resolve, runtimeIdMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelId, getChannelType, getGuildChannel, getGuildLocale, getMessageChannel, getType, isFromAttachedGuild, isFromGuildMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
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 underlyingGenericCommandInteractionEventand casts it to the given type.- Type Parameters:
T- a subtype ofGenericCommandInteractionEvent- Parameters:
type- a subtype ofGenericCommandInteractionEvent, likeSlashCommandInteractionEvent- Returns:
Tthe event
-
deferReply
public void deferReply(boolean ephemeral) Description copied from class:ReplyableEventAcknowledge 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. UseReplyableEvent.deferReply()to use theInteractionDefinition.ReplyConfigfor 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:
deferReplyin classReplyableEvent<net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent>- Parameters:
ephemeral- yes
-