Class ModalEvent
- All Implemented Interfaces:
net.dv8tion.jda.api.entities.ISnowflake, net.dv8tion.jda.api.interactions.Interaction
Event. It provides additional features for replying to a ModalInteractionEvent as
well as for retrieving the ModalMappings.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNo-op acknowledgement of this interaction.voiddeferReply(boolean ephemeral) Acknowledge this interaction and defer the reply to a later time.net.dv8tion.jda.api.interactions.modals.ModalMappingvalue(int uniqueId) Convenience method to get aModalMappingby its numeric id from the List of ModalMappings<T> io.github.kaktushose.proteus.conversion.ConversionResult<T> net.dv8tion.jda.api.interactions.modals.ModalMappingConvenience method to get aModalMappingby its id from the List of ModalMappings.<T> io.github.kaktushose.proteus.conversion.ConversionResult<T> List<net.dv8tion.jda.api.interactions.modals.ModalMapping> values()Returns a List of ModalMappings representing the values input by the user for each field when the modal was submitted.Methods inherited from class ReplyableEvent
deferReply, embed, findEmbed, getButton, getButton, getSelectMenu, getSelectMenu, reply, reply, reply, reply, reply, withMethods inherited from class Event
closeRuntime, getChannel, getChannelIdLong, getContext, getEntitlements, getGuild, getIdLong, getIntegrationOwners, getJDA, getMember, getToken, getTypeRaw, getUser, getUserLocale, interactionInstance, introspection, isAcknowledged, jdaEvent, kv, messageResolver, resolve, resolve, runtimeIdMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelId, getChannelType, getGuildChannel, getGuildLocale, getMessageChannel, getType, isFromAttachedGuild, isFromGuildMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
ModalEvent
public ModalEvent()
-
-
Method Details
-
deferReply
public void deferReply(boolean ephemeral) Description copied from class:ReplyableEventAcknowledge 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. This will use the passed boolean to set the ephemeral flag. If your initial deferred message is ephemeral it cannot be made non-ephemeral later. UseReplyableEvent.deferReply()to use theInteractionDefinition.ReplyConfigfor the ephemeral flag.You only have 3 seconds to acknowledge an interaction!
When the acknowledgement is sent after the interaction expired, you will receive
ErrorResponse.UNKNOWN_INTERACTION.Use
ReplyableEvent.reply(String, Entry...)to reply directly.- Specified by:
deferReplyin classReplyableEvent<net.dv8tion.jda.api.events.interaction.ModalInteractionEvent>- Parameters:
ephemeral- yes
-
deferEdit
public void deferEdit()No-op acknowledgement of this interaction.
This tells discord you intend to update the message that the triggering component is a part of 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 receive
ErrorResponse.UNKNOWN_INTERACTION.Use
ReplyableEvent.reply(String, Entry...)to edit it directly. -
values
Returns a List of ModalMappings representing the values input by the user for each field when the modal was submitted.- Returns:
- Immutable List of ModalMappings
- See Also:
-
value
Convenience method to get aModalMappingby its id from the List of ModalMappings.- Parameters:
customId- The custom id- Returns:
ModalMappingwith this id, or null if not found- Throws:
NullPointerException- If no value was found for the provided idIllegalArgumentException- If the provided id is null- See Also:
-
value
public net.dv8tion.jda.api.interactions.modals.ModalMapping value(int uniqueId) Convenience method to get aModalMappingby its numeric id from the List of ModalMappings- Parameters:
uniqueId- The uniqueId id- Returns:
ModalMappingwith this numeric id, or null if not found- Throws:
NullPointerException- If no value was found for the provided idIllegalArgumentException- If the provided id is null- See Also:
-
value
-
value
-