Class ModalSubmitInteractionEvent
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.ComponentInteractionEvent
discord4j.core.event.domain.interaction.ModalSubmitInteractionEvent
Dispatched when a user has pressed submit on a modal presented to them earlier
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 editedComponentInteractionEvent.edit()
to modify the message that presented the modalComponentInteractionEvent.deferEdit()
to acknowledge without a message, will not display a loading state and allows later modifications to the message that presented the modal
DeferrableInteractionEvent.editReply()
to edit the initial responseDeferrableInteractionEvent.getReply()
to fetch the initial responseDeferrableInteractionEvent.deleteReply()
to delete the initial response
DeferrableInteractionEvent.createFollowup()
to create a followup messageDeferrableInteractionEvent.editFollowup(Snowflake)
to update a followup message, given its IDDeferrableInteractionEvent.deleteFollowup(Snowflake)
to delete a followup message, given its ID
This is not directly dispatched by Discord, but is a utility specialization of InteractionCreateEvent
.
- See Also:
-
Constructor Summary
ConstructorDescriptionModalSubmitInteractionEvent
(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction) -
Method Summary
Modifier and TypeMethodDescriptionGets the components from the modal<T extends MessageComponent>
List<T>getComponents
(Class<T> componentType) Gets the components from the modal that match the given component type.Gets the developer defined custom ID of this modalpresentModal
(discord4j.core.spec.InteractionPresentModalSpec spec) Requests to respond to the interaction by presenting a modal for the user to fill out and submit with the given spec contents.Methods inherited from class discord4j.core.event.domain.interaction.ComponentInteractionEvent
acknowledge, acknowledgeEphemeral, deferEdit, deferEdit, edit, edit, edit, edit, getMessage, getMessageId
Methods inherited from class discord4j.core.event.domain.interaction.DeferrableInteractionEvent
createFollowup, createFollowup, createFollowup, deferReply, deferReply, deleteFollowup, deleteReply, editFollowup, editFollowup, editReply, editReply, editReply, getInteractionResponse, getReply, 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
-
ModalSubmitInteractionEvent
public ModalSubmitInteractionEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction)
-
-
Method Details
-
getCustomId
Gets the developer defined custom ID of this modal- Overrides:
getCustomId
in classComponentInteractionEvent
- Returns:
- The custom ID of this modal
- See Also:
-
getComponents
Gets the components from the modal- Returns:
- The components from the modal
-
getComponents
Gets the components from the modal that match the given component type.- Parameters:
componentType
- the modal component type to return- Returns:
- The components from the modal
-
presentModal
Description copied from class:DeferrableInteractionEvent
Requests to respond to the interaction by presenting a modal for the user to fill out and submit with the given spec contents. Once the user submits the modal, it will be received as a newModalSubmitInteractionEvent
.- Overrides:
presentModal
in classDeferrableInteractionEvent
- Parameters:
spec
- an immutable object that specifies how to present the modal window- Returns:
- A
Mono
where, upon successful completion, emits nothing; indicating the interaction response has been sent. If an error is received, it is emitted through theMono
.
-