Interface ButtonInteraction
-
- All Superinterfaces:
ComponentInteraction
,Interaction
,ISnowflake
- All Known Implementing Classes:
ButtonClickEvent
public interface ButtonInteraction extends ComponentInteraction
Interaction on aButton
component.- See Also:
ButtonClickEvent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RestAction<java.lang.Void>
editButton(Button newButton)
Update the button with a new button instance.Button
getButton()
TheButton
this interaction belongs to.default Button
getComponent()
TheComponent
instance.-
Methods inherited from interface net.dv8tion.jda.api.interactions.components.ComponentInteraction
deferEdit, editComponents, editComponents, editMessage, editMessage, editMessageEmbeds, editMessageEmbeds, editMessageFormat, getChannel, getComponentId, getComponentType, getMessage, getMessageId, getMessageIdLong
-
Methods inherited from interface net.dv8tion.jda.api.interactions.Interaction
deferReply, deferReply, getChannelType, getGuild, getGuildChannel, getHook, getJDA, getMember, getMessageChannel, getPrivateChannel, getTextChannel, getToken, getType, getTypeRaw, getUser, getVoiceChannel, isAcknowledged, isFromGuild, reply, reply, replyEmbeds, replyEmbeds, replyFormat
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
-
-
-
Method Detail
-
getComponent
@Nullable default Button getComponent()
Description copied from interface:ComponentInteraction
TheComponent
instance.
This is null on interactions for ephemeral messages.- Specified by:
getComponent
in interfaceComponentInteraction
- Returns:
- The
Component
, or null if this message is ephemeral
-
getButton
@Nullable Button getButton()
TheButton
this interaction belongs to.
This is null for ephemeral messages!- Returns:
- The
Button
- See Also:
ComponentInteraction.getComponentId()
-
editButton
@Nonnull @CheckReturnValue default RestAction<java.lang.Void> editButton(@Nullable Button newButton)
Update the button with a new button instance.If this interaction is already acknowledged this will use
Interaction.getHook()
and otherwiseComponentInteraction.editComponents(Collection)
directly to acknowledge the interaction.- Parameters:
newButton
- The new button to use, or null to remove this button from the message entirely- Returns:
RestAction
- Throws:
java.lang.IllegalStateException
- If this interaction was triggered by a button on an ephemeral message.
-
-