Class UserInteractionEvent
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
discord4j.core.event.domain.interaction.UserInteractionEvent
Dispatched when a user uses a user command (user context menu)
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
InteractionCreateEvent
for more details about valid operations.
This is not directly dispatched by Discord, but is a utility specialization of
ApplicationCommandInteractionEvent
.
-
Constructor Summary
ConstructorDescriptionUserInteractionEvent
(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction) -
Method Summary
Modifier and TypeMethodDescriptionGets the resolved targeted User.Gets the ID of the targeted User.Requests to retrieve the targeted User.getTargetUser
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the targeted User.Methods inherited from class discord4j.core.event.domain.interaction.ApplicationCommandInteractionEvent
getCommandId, getCommandName, getCommandType
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, createInteractionResponse, getInteraction
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
Constructor Details
-
UserInteractionEvent
public UserInteractionEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction)
-
-
Method Details
-
getResolvedUser
Gets the resolved targeted User.- Returns:
- The resolved targeted User.
-
getTargetId
Gets the ID of the targeted User.- Returns:
- The ID of the targeted User.
-
getTargetUser
Requests to retrieve the targeted User. -
getTargetUser
Requests to retrieve the targeted User.
-