Interface ModalInteraction
- All Superinterfaces:
ICustomIdInteraction
,IDeferrableCallback
,IMessageEditCallback
,Interaction
,IReplyCallback
,ISnowflake
- All Known Implementing Classes:
ModalInteractionEvent
public interface ModalInteraction
extends IReplyCallback, IMessageEditCallback, ICustomIdInteraction
Interaction on a
Modal
If the modal of this interaction was a reply to a ComponentInteraction
,
you can also use IMessageEditCallback.deferEdit()
to edit the original message that contained the component instead of replying.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionThe channel this interaction happened in.default String
The relevant custom ID, that has been provided for the component or modal when it was originally created.default GuildMessageChannelUnion
TheGuildChannel
this interaction happened in.Message this modal came from, if it was a reply to aComponentInteraction
.Returns the custom id of the Modal in questiondefault ModalMapping
Convenience method to get aModalMapping
by its id from the List ofModalMappings
default ModalMapping
getValueByUniqueId
(int id) Convenience method to get aModalMapping
by its numeric id from the List ofModalMappings
@Unmodifiable List
<ModalMapping> Returns a List ofModalMappings
representing the values input by the user for each field when the modal was submitted.Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IDeferrableCallback
getHook
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IMessageEditCallback
deferEdit, 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, 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
-
Method Details
-
getCustomId
Description copied from interface:ICustomIdInteraction
The relevant custom ID, that has been provided for the component or modal when it was originally created.
This value should be used to determine what action to take in regard to this interaction.
This id does not have to be numerical.- Specified by:
getCustomId
in interfaceICustomIdInteraction
- Returns:
- The custom ID
- See Also:
-
getModalId
Returns the custom id of the Modal in question- Returns:
- Custom id
- See Also:
-
getValues
Returns a List ofModalMappings
representing the values input by the user for each field when the modal was submitted.- Returns:
- Immutable List of
ModalMappings
- See Also:
-
getValue
Convenience method to get aModalMapping
by its id from the List ofModalMappings
Returns null if no component with that id has been found
- Parameters:
customId
- The custom id- Returns:
- ModalMapping with this id, or null if not found
- Throws:
IllegalArgumentException
- If the provided id is null- See Also:
-
getValueByUniqueId
Convenience method to get aModalMapping
by its numeric id from the List ofModalMappings
Returns null if no component with that id has been found
- Parameters:
id
- The numeric id- Returns:
- ModalMapping with this numeric id, or null if not found
- Throws:
IllegalArgumentException
- If the provided id is null- See Also:
-
getMessage
Message this modal came from, if it was a reply to aComponentInteraction
.- Returns:
- The message the component is attached to, or
null
-
getChannel
Description copied from interface:Interaction
The channel this interaction happened in.- Specified by:
getChannel
in interfaceInteraction
- Returns:
- The channel or null if the channel is not provided
-
getGuildChannel
Description copied from interface:Interaction
TheGuildChannel
this interaction happened in.
IfInteraction.getChannelType()
is not a guild type, this throwsIllegalStateException
!- Specified by:
getGuildChannel
in interfaceInteraction
- Returns:
- The
GuildChannel
-