Class EditableConfigurableReply


public final class EditableConfigurableReply extends ConfigurableReply
Subtype of ConfigurableReply that is used for ComponentInteractions, where you can also edit the original reply instead of sending a new one.
  • Constructor Details

  • Method Details

    • editReply

      public EditableConfigurableReply editReply(boolean 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 any ReplyConfig annotation!

      Parameters:
      editReply - true if to keep the original components
      Returns:
      the current instance for fluent interface
    • keepComponents

      public EditableConfigurableReply keepComponents(boolean keepComponents)

      Whether to keep the original components when editing a message. Default value is true.

      More formally, if editing a message and keepComponents is true, 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 any ReplyConfig annotation!

      Parameters:
      keepComponents - true if to edit the original method
      Returns:
      the current instance for fluent interface
    • keepSelections

      public EditableConfigurableReply keepSelections(boolean keepSelections)
      Whether to keep the selections of a string select menu when sending edits. This setting only has an effect with keepComponents(boolean) true.
      Parameters:
      keepSelections - true if to keep the selections
      Returns:
      the current instance for fluent interface
    • reply

      public Message reply()

      No-op acknowledgement of this event with the V2 Components of the original reply.

      Calling this method will enforce keepComponents(boolean) to true to retrieve the original components.

      Throws:
      UnsupportedOperationException - if the original message didn't use V2 Components
    • reply

      public Message reply(ComponentReplacer replacer, Entry... placeholder)

      Acknowledgement of this event with the V2 Components of the original reply. Will also apply the passed ComponentReplacer before sending the reply.

      Calling this method will enforce keepComponents(boolean) to true to retrieve the original components.

      Parameters:
      replacer - the ComponentReplacer to apply to the original components
      placeholder - the placeholders to use. See PlaceholderResolver
      Throws:
      UnsupportedOperationException - if the original message didn't use V2 Components
      Implementation Note:
      The ComponentReplacer only gets applied after the original components were retrieved and, if keepSelections(boolean) is set to true, after the selections are retrieved.