Class EditableConfigurableReply
ConfigurableReply that is used for ComponentInteractions,
where you can also edit the original reply instead of sending a new one.-
Field Summary
Fields inherited from class MessageReply
replyAction -
Constructor Summary
ConstructorsConstructorDescriptionEditableConfigurableReply(InteractionDefinition.ReplyConfig replyConfig, net.dv8tion.jda.api.interactions.components.ComponentInteraction interaction) Constructs a new ConfigurableReply. -
Method Summary
Modifier and TypeMethodDescriptioneditReply(boolean editReply) Whether to edit the original message or to send a new one.keepComponents(boolean keepComponents) Whether to keep the original components when editing a message.keepSelections(boolean keepSelections) Whether to keep the selections of a string select menu when sending edits.net.dv8tion.jda.api.entities.Messagereply(net.dv8tion.jda.api.components.replacer.ComponentReplacer... replacer) Acknowledgement of this event with the V2 Components of the original reply.Methods inherited from class ConfigurableReply
ephemeral, replyMethods inherited from class MessageReply
builder, components, components, embeds, embeds, embeds, embeds, reply, resolve
-
Constructor Details
-
EditableConfigurableReply
public EditableConfigurableReply(InteractionDefinition.ReplyConfig replyConfig, net.dv8tion.jda.api.interactions.components.ComponentInteraction interaction) Constructs a new ConfigurableReply.- Parameters:
replyConfig- the underlyingInteractionDefinition.ReplyConfig
-
-
Method Details
-
editReply
Whether to edit the original message or to send a new one. Default value is
true.The original message is always the very first reply that was sent. E.g. for a slash command event, which was replied to with a text message and a button, the original message is that very reply.
Subsequent replies to the same slash command event or the button event cannot be edited.
This will override both
JDACBuilder.globalReplyConfig(InteractionDefinition.ReplyConfig)and anyReplyConfigannotation!- Parameters:
editReply-trueif to keep the original components- Returns:
- the current instance for fluent interface
-
keepComponents
Whether to keep the original components when editing a message. Default value is
true.More formally, if editing a message and
keepComponentsistrue, the original message will first be queried and its components get added to the reply before it is sent.This will override both
JDACBuilder.globalReplyConfig(InteractionDefinition.ReplyConfig)and anyReplyConfigannotation!- Parameters:
keepComponents-trueif to edit the original method- Returns:
- the current instance for fluent interface
-
keepSelections
Whether to keep the selections of a string select menu when sending edits. This setting only has an effect withkeepComponents(boolean)true.- Parameters:
keepSelections-trueif to keep the selections- Returns:
- the current instance for fluent interface
-
reply
public net.dv8tion.jda.api.entities.Message reply(net.dv8tion.jda.api.components.replacer.ComponentReplacer... replacer) Acknowledgement of this event with the V2 Components of the original reply. Will also apply the passed
ComponentReplacerbefore sending the reply.This method will always set
keepComponents(boolean)totrueto retrieve the original components.- Parameters:
replacer- theComponentReplacerto apply to the original components- Throws:
UnsupportedOperationException- if the original message didn't use V2 Components
-