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 respectiveMessageChannelUnion
for this interaction.TheActionComponent
instance.The custom component ID provided to the component when it was originally created.TheComponent.Type
default GuildMessageChannelUnion
TheGuildChannel
this interaction happened in.TheMessage
instance.default String
The id of the message.long
The id of the message.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, editMessage, editMessage, editMessageAttachments, editMessageAttachments, editMessageEmbeds, editMessageEmbeds, editMessageFormat
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IModalCallback
replyModal
Methods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelId, getChannelIdLong, getChannelType, getEntitlements, getGuild, getGuildLocale, getJDA, getMember, getMessageChannel, getToken, getType, getTypeRaw, getUser, getUserLocale, isAcknowledged, isFromGuild
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IPremiumRequiredReplyCallback
replyWithPremiumRequired
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IReplyCallback
deferReply, deferReply, reply, reply, replyComponents, replyComponents, replyEmbeds, replyEmbeds, replyFiles, replyFiles, replyFormat, replyPoll
Methods 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
TheActionComponent
instance.- Returns:
- The
ActionComponent
-
getMessage
TheMessage
instance.- 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 respectiveMessageChannelUnion
for this interaction.- Specified by:
getChannel
in interfaceInteraction
- Returns:
- The
MessageChannelUnion
-
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
-