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, 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.reply()No-op acknowledgement of this event with the V2 Components of the original reply.reply(ComponentReplacer replacer, Entry... placeholder) Acknowledgement of this event with the V2 Components of the original reply.Methods inherited from class ConfigurableReply
allowedMentions, ephemeral, mention, mention, reply, reply, silentMethods inherited from class MessageReply
builder, components, components, embeds, embeds, embeds, embeds, reply, resolver
-
Constructor Details
-
EditableConfigurableReply
public EditableConfigurableReply(InteractionDefinition.ReplyConfig replyConfig, 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
No-op acknowledgement of this event with the V2 Components of the original reply.
Calling this method will enforce
keepComponents(boolean)totrueto retrieve the original components.- Throws:
UnsupportedOperationException- if the original message didn't use V2 Components
-
reply
Acknowledgement of this event with the V2 Components of the original reply. Will also apply the passed
ComponentReplacerbefore sending the reply.Calling this method will enforce
keepComponents(boolean)totrueto retrieve the original components.- Parameters:
replacer- theComponentReplacerto apply to the original componentsplaceholder- the placeholders to use. SeePlaceholderResolver- Throws:
UnsupportedOperationException- if the original message didn't use V2 Components- Implementation Note:
- The
ComponentReplaceronly gets applied after the original components were retrieved and, ifkeepSelections(boolean)is set totrue, after the selections are retrieved.
-