Class ModalInteractionImpl
java.lang.Object
net.dv8tion.jda.internal.interactions.InteractionImpl
net.dv8tion.jda.internal.interactions.DeferrableInteractionImpl
net.dv8tion.jda.internal.interactions.modal.ModalInteractionImpl
- All Implemented Interfaces:
ISnowflake
,IDeferrableCallback
,IMessageEditCallback
,IReplyCallback
,Interaction
,ModalInteraction
-
Constructor Summary
Constructors -
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.Message this modal came from, if it was a reply to aComponentInteraction
.Returns the custom id of the Modal in questionReturns a List ofModalMappings
representing the values input by the user for each field when the modal was submitted.Methods inherited from class net.dv8tion.jda.internal.interactions.DeferrableInteractionImpl
getHook, releaseHook
Methods inherited from class net.dv8tion.jda.internal.interactions.InteractionImpl
ack, getChannelIdLong, getContext, getEntitlements, getGuild, getIdLong, getIntegrationOwners, getJDA, getMember, getToken, getTypeRaw, getUser, getUserLocale, isAcknowledged
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IDeferrableCallback
getHook
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IMessageEditCallback
editComponents, editComponents, editComponents, editMessage, editMessage, editMessageAttachments, editMessageAttachments, editMessageEmbeds, editMessageEmbeds, editMessageFormat
Methods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelId, getChannelIdLong, getChannelType, getContext, getEntitlements, getGuild, getGuildLocale, getIntegrationOwners, getJDA, getMember, getMessageChannel, getToken, getType, getTypeRaw, getUser, getUserLocale, isAcknowledged, isFromAttachedGuild, isFromGuild
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IReplyCallback
deferReply, reply, reply, replyComponents, replyComponents, replyComponents, replyEmbeds, replyEmbeds, replyFiles, replyFiles, replyFormat, replyPoll
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
Methods inherited from interface net.dv8tion.jda.api.interactions.modals.ModalInteraction
getGuildChannel, getValue, getValueByUniqueId
-
Constructor Details
-
ModalInteractionImpl
-
-
Method Details
-
getModalId
Description copied from interface:ModalInteraction
Returns the custom id of the Modal in question- Specified by:
getModalId
in interfaceModalInteraction
- Returns:
- Custom id
- See Also:
-
getValues
Description copied from interface:ModalInteraction
Returns a List ofModalMappings
representing the values input by the user for each field when the modal was submitted.- Specified by:
getValues
in interfaceModalInteraction
- Returns:
- Immutable List of
ModalMappings
- See Also:
-
getMessage
Description copied from interface:ModalInteraction
Message this modal came from, if it was a reply to aComponentInteraction
.- Specified by:
getMessage
in interfaceModalInteraction
- Returns:
- The message the component is attached to, or
null
-
deferReply
Description copied from interface:IReplyCallback
Acknowledge 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 theInteractionHook
will 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:
deferReply
in interfaceIReplyCallback
- Returns:
ReplyCallbackAction
-
deferEdit
Description copied from interface:IMessageEditCallback
No-op acknowledgement of this interaction.
This tells discord you intend to update the message that the triggering component is a part of using theInteractionHook
instead 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:
deferEdit
in interfaceIMessageEditCallback
- Returns:
MessageEditCallbackAction
that can be used to update the message- See Also:
-
getChannel
Description copied from interface:Interaction
The channel this interaction happened in.- Specified by:
getChannel
in interfaceInteraction
- Specified by:
getChannel
in interfaceModalInteraction
- Overrides:
getChannel
in classInteractionImpl
- Returns:
- The channel or null if the channel is not provided
-