Interface ComponentInteraction
- All Superinterfaces:
ICustomIdInteraction,IDeferrableCallback,IMessageEditCallback,IModalCallback,Interaction,IReplyCallback,ISnowflake
- All Known Subinterfaces:
ButtonInteraction,EntitySelectInteraction,SelectMenuInteraction<T,,S> StringSelectInteraction
- All Known Implementing Classes:
ButtonInteractionEvent,EntitySelectInteractionEvent,GenericComponentInteractionCreateEvent,GenericSelectMenuInteractionEvent,StringSelectInteractionEvent
public interface ComponentInteraction
extends IReplyCallback, IMessageEditCallback, IModalCallback, ICustomIdInteraction
Interaction on a message
ActionComponent.
Instead of IReplyCallback.deferReply() and IReplyCallback.reply(String) you can use IMessageEditCallback.deferEdit() and IMessageEditCallback.editMessage(String) with these interactions!
You can only acknowledge an interaction once!
-
Method Summary
Modifier and TypeMethodDescriptionThe respectiveMessageChannelUnionfor this interaction.TheActionComponentinstance.The custom component ID provided to the component when it was originally created.TheComponent.Typedefault StringThe relevant custom ID, that has been provided for the component or modal when it was originally created.default GuildMessageChannelUnionTheGuildChannelthis interaction happened in.TheMessageinstance.default StringThe id of the message.longThe id of the message.default intThe numeric component ID provided to the component when it was originally created.Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IDeferrableCallback
getHookMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IMessageEditCallback
deferEdit, editComponents, editComponents, editComponents, editMessage, editMessage, editMessageAttachments, editMessageAttachments, editMessageEmbeds, editMessageEmbeds, editMessageFormatMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IModalCallback
replyModalMethods 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, isFromGuildMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IReplyCallback
deferReply, deferReply, reply, reply, replyComponents, replyComponents, replyComponents, replyEmbeds, replyEmbeds, replyFiles, replyFiles, replyFormat, replyPollMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getCustomId
Description copied from interface:ICustomIdInteractionThe 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:
getCustomIdin interfaceICustomIdInteraction- Returns:
- The custom ID
- See Also:
-
getComponentId
The custom component ID provided to the component 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.- Returns:
- The component ID
- See Also:
-
getUniqueId
default int getUniqueId()The numeric component ID provided to the component when it was originally created.
This value is typically used to uniquely identify the component.- Returns:
- The unique, numeric component ID
- See Also:
-
getComponent
TheActionComponentinstance.- Returns:
- The
ActionComponent
-
getMessage
TheMessageinstance.- Returns:
- The
Message
-
getMessageIdLong
long getMessageIdLong()The id of the message.- Returns:
- The message id
-
getMessageId
The id of the message.- Returns:
- The message id
-
getComponentType
TheComponent.Type- Returns:
- The
Component.Type
-
getChannel
The respectiveMessageChannelUnionfor this interaction.- Specified by:
getChannelin interfaceInteraction- Returns:
- The
MessageChannelUnion
-
getGuildChannel
Description copied from interface:InteractionTheGuildChannelthis interaction happened in.
IfInteraction.getChannelType()is not a guild type, this throwsIllegalStateException!- Specified by:
getGuildChannelin interfaceInteraction- Returns:
- The
GuildChannel
-