Class ApplicationCommandInteractionEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.interaction.InteractionCreateEvent
-
- discord4j.core.event.domain.interaction.DeferrableInteractionEvent
-
- discord4j.core.event.domain.interaction.ApplicationCommandInteractionEvent
-
- Direct Known Subclasses:
ChatInputInteractionEvent,MessageInteractionEvent,UserInteractionEvent
@Experimental public class ApplicationCommandInteractionEvent extends DeferrableInteractionEvent
Dispatched when a user uses an Application Command.You are required to respond to this interaction within a three-second window by using one of the following:
DeferrableInteractionEvent.reply()to directly include a messageDeferrableInteractionEvent.deferReply()to acknowledge without a message, typically to perform a background task and give the user a loading state until it is editedDeferrableInteractionEvent.presentModal(String, String, Collection)to pop a modal for the user to interact with
InteractionCreateEventfor more details about valid operations.This is not directly dispatched by Discord, but is a utility specialization of
InteractionCreateEvent.
-
-
Constructor Summary
Constructors Constructor Description ApplicationCommandInteractionEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SnowflakegetCommandId()Gets the ID of the invoked command.StringgetCommandName()Gets the name of the invoked command.ApplicationCommand.TypegetCommandType()Gets the type of the invoked command.-
Methods inherited from class discord4j.core.event.domain.interaction.DeferrableInteractionEvent
acknowledge, acknowledgeEphemeral, createFollowup, createFollowup, createFollowup, deferReply, deferReply, deleteFollowup, deleteReply, editFollowup, editFollowup, editReply, editReply, editReply, getInteractionResponse, getReply, presentModal, presentModal, presentModal, reply, reply, reply, reply
-
Methods inherited from class discord4j.core.event.domain.interaction.InteractionCreateEvent
createInteractionResponse, getInteraction
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Constructor Detail
-
ApplicationCommandInteractionEvent
public ApplicationCommandInteractionEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction)
-
-
Method Detail
-
getCommandId
public Snowflake getCommandId()
Gets the ID of the invoked command.- Returns:
- The ID of the invoked command.
-
getCommandName
public String getCommandName()
Gets the name of the invoked command.- Returns:
- The name of the invoked command.
-
getCommandType
public ApplicationCommand.Type getCommandType()
Gets the type of the invoked command.- Returns:
- The type of the invoked command.
-
-