Interface ComponentInteraction
-
- All Superinterfaces:
IDeferrableCallback
,IMessageEditCallback
,Interaction
,IReplyCallback
,ISnowflake
- All Known Subinterfaces:
ButtonInteraction
,SelectMenuInteraction
- All Known Implementing Classes:
ButtonInteractionEvent
,GenericComponentInteractionCreateEvent
,SelectMenuInteractionEvent
public interface ComponentInteraction extends IReplyCallback, IMessageEditCallback
Interaction on a messageActionComponent
.Instead of
IReplyCallback.deferReply()
andIReplyCallback.reply(String)
you can useIMessageEditCallback.deferEdit()
andIMessageEditCallback.editMessage(String)
with these interactions! You can only acknowledge an interaction once!
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MessageChannel
getChannel()
The respectiveMessageChannel
for this interaction.ActionComponent
getComponent()
TheActionComponent
instance.String
getComponentId()
The custom component ID provided to the component when it was originally created.Component.Type
getComponentType()
TheComponent.Type
Message
getMessage()
TheMessage
instance.default String
getMessageId()
The id of the message.long
getMessageIdLong()
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, editMessageEmbeds, editMessageEmbeds, editMessageFormat
-
Methods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelType, getGuild, getGuildChannel, getGuildLocale, getJDA, getMember, getMessageChannel, getNewsChannel, getPrivateChannel, getTextChannel, getThreadChannel, getToken, getType, getTypeRaw, getUser, getUserLocale, getVoiceChannel, isAcknowledged, isFromGuild
-
Methods inherited from interface net.dv8tion.jda.api.interactions.callbacks.IReplyCallback
deferReply, deferReply, reply, reply, replyEmbeds, replyEmbeds, replyFile, replyFile, replyFile, replyFile, replyFormat
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
-
-
-
Method Detail
-
getComponentId
@Nonnull String 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:
ActionComponent.getId()
-
getComponent
@Nonnull ActionComponent getComponent()
TheActionComponent
instance.- Returns:
- The
ActionComponent
-
getMessageIdLong
long getMessageIdLong()
The id of the message.- Returns:
- The message id
-
getComponentType
@Nonnull Component.Type getComponentType()
TheComponent.Type
- Returns:
- The
Component.Type
-
getChannel
@Nonnull MessageChannel getChannel()
The respectiveMessageChannel
for this interaction.- Specified by:
getChannel
in interfaceInteraction
- Returns:
- The
MessageChannel
-
-