Class ModalInteractionEvent
- All Implemented Interfaces:
ISnowflake,GenericEvent,IDeferrableCallback,IMessageEditCallback,IReplyCallback,Interaction,ModalInteraction
Modal was submitted.
Requirements
To receive these events, you must unset the Interactions Endpoint URL in your application dashboard.
You can simply remove the URL for this endpoint in your settings at the Discord Developers Portal.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionModalInteractionEvent(JDA api, long responseNumber, ModalInteraction interaction) -
Method Summary
Modifier and TypeMethodDescriptionNo-op acknowledgement of this interaction.Acknowledge this interaction and defer the reply to a later time.The channel this interaction happened in.getHook()TheInteractionHookwhich can be used to send deferred replies or followup messages.TheInteractioninstance.Message this modal came from, if it was a reply to aComponentInteraction.Returns the custom id of the Modal in questionReturns a List ofModalMappingsrepresenting the values input by the user for each field when the modal was submitted.Methods inherited from class net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent
getChannelIdLong, getEntitlements, getGuild, getGuildLocale, getIdLong, getMember, getToken, getTypeRaw, getUser, getUserLocale, isAcknowledgedMethods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumber, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IMessageEditCallback
editComponents, editComponents, editMessage, editMessage, editMessageAttachments, editMessageAttachments, editMessageEmbeds, editMessageEmbeds, editMessageFormatMethods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelId, getChannelIdLong, getChannelType, getEntitlements, getGuild, getGuildLocale, getJDA, getMember, getMessageChannel, getToken, getType, getTypeRaw, getUser, getUserLocale, isAcknowledged, isFromGuildMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IReplyCallback
deferReply, reply, reply, replyComponents, replyComponents, replyEmbeds, replyEmbeds, replyFiles, replyFiles, replyFormat, replyPollMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreatedMethods inherited from interface net.dv8tion.jda.api.interactions.modals.ModalInteraction
getGuildChannel, getValue
-
Constructor Details
-
ModalInteractionEvent
public ModalInteractionEvent(@Nonnull JDA api, long responseNumber, @Nonnull ModalInteraction interaction)
-
-
Method Details
-
getInteraction
Description copied from class:GenericInteractionCreateEventTheInteractioninstance.
Note that this event is a delegate which implements the same interface.- Overrides:
getInteractionin classGenericInteractionCreateEvent- Returns:
- The
Interaction
-
getModalId
Description copied from interface:ModalInteractionReturns the custom id of the Modal in question- Specified by:
getModalIdin interfaceModalInteraction- Returns:
- Custom id
- See Also:
-
getValues
Description copied from interface:ModalInteractionReturns a List ofModalMappingsrepresenting the values input by the user for each field when the modal was submitted.- Specified by:
getValuesin interfaceModalInteraction- Returns:
- Immutable List of
ModalMappings - See Also:
-
getMessage
Description copied from interface:ModalInteractionMessage this modal came from, if it was a reply to aComponentInteraction.- Specified by:
getMessagein interfaceModalInteraction- Returns:
- The message the component is attached to, or
null
-
deferReply
Description copied from interface:IReplyCallbackAcknowledge 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 through eitherInteractionHook.editOriginal(String)orWebhookClient.sendMessage(String).You can use
deferReply(true)to send a deferred ephemeral reply. If your initial deferred message is not ephemeral it cannot be made ephemeral later. Your first message to theInteractionHookwill inherit whether the message is ephemeral or not from this deferred reply.You only have 3 seconds to acknowledge an interaction!
When the acknowledgement is sent after the interaction expired, you will receiveErrorResponse.UNKNOWN_INTERACTION.Use
IReplyCallback.reply(String)to reply directly.- Specified by:
deferReplyin interfaceIReplyCallback- Returns:
ReplyCallbackAction
-
getHook
Description copied from interface:IDeferrableCallbackTheInteractionHookwhich can be used to send deferred replies or followup messages.- Specified by:
getHookin interfaceIDeferrableCallback- Returns:
- The interaction hook
-
deferEdit
Description copied from interface:IMessageEditCallbackNo-op acknowledgement of this interaction.
This tells discord you intend to update the message that the triggering component is a part of using theInteractionHookinstead of sending a reply message. You are not required to actually update the message, this will simply acknowledge that you accepted the interaction.You only have 3 seconds to acknowledge an interaction!
When the acknowledgement is sent after the interaction expired, you will receiveErrorResponse.UNKNOWN_INTERACTION.Use
IMessageEditCallback.editMessage(String)to edit it directly.- Specified by:
deferEditin interfaceIMessageEditCallback- Returns:
MessageEditCallbackActionthat can be used to update the message- See Also:
-
getChannel
Description copied from interface:InteractionThe channel this interaction happened in.- Specified by:
getChannelin interfaceInteraction- Specified by:
getChannelin interfaceModalInteraction- Overrides:
getChannelin classGenericInteractionCreateEvent- Returns:
- The channel or null if the channel is not provided
-