Interface ComponentInteraction
- All Superinterfaces:
IDeferrableCallback,IMessageEditCallback,IModalCallback,Interaction,IPremiumRequiredReplyCallback,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, IPremiumRequiredReplyCallback
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 GuildMessageChannelUnionTheGuildChannelthis interaction happened in.TheMessageinstance.default StringThe id of the message.longThe id of the message.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, 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.IPremiumRequiredReplyCallback
replyWithPremiumRequiredMethods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IReplyCallback
deferReply, deferReply, reply, reply, replyComponents, replyComponents, replyEmbeds, replyEmbeds, replyFiles, replyFiles, replyFormat, replyPollMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
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:
-
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
-