Class MessageInteractionEvent
- 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.MessageInteractionEvent
-
@Experimental public class MessageInteractionEvent extends ApplicationCommandInteractionEvent
Dispatched when a user uses a message command (message 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 edited
InteractionCreateEvent
for more details about valid operations.This is not directly dispatched by Discord, but is a utility specialization of
ApplicationCommandInteractionEvent
.
-
-
Constructor Summary
Constructors Constructor Description MessageInteractionEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Message
getResolvedMessage()
Gets the resolved targeted Message.Snowflake
getTargetId()
Gets the ID of the targeted Message.Mono<Message>
getTargetMessage()
Requests to retrieve the targeted Message.Mono<Message>
getTargetMessage(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the targeted Message.-
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, 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
-
MessageInteractionEvent
public MessageInteractionEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction)
-
-
Method Detail
-
getResolvedMessage
public Message getResolvedMessage()
Gets the resolved targeted Message.- Returns:
- The resolved targeted Message.
-
getTargetId
public Snowflake getTargetId()
Gets the ID of the targeted Message.- Returns:
- The ID of the targeted Message.
-
getTargetMessage
public Mono<Message> getTargetMessage(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the targeted Message.
-
-