Annotation Interface ReplyConfig


@Target({TYPE,METHOD}) @Retention(RUNTIME) public @interface ReplyConfig

Used to configure the reply behaviour of interaction replies.

Interaction methods annotated with ReplyConfig will use the configured values of this annotation when sending a reply. Interaction classes annotated with ReplyConfig will apply the configured values of this annotation to every method, if and only if no annotation is present at method level. If the ReplyConfig annotation is neither present at the class level nor the method level, the global ReplyConfig will be used instead.

These values are always overridden by ConfigurableReply.ephemeral(boolean), ConfigurableReply.keepComponents(boolean) or respectively ConfigurableReply.editReply(boolean).

In other words the hierarchy is as following:

  1. ConfigurableReply
  2. ReplyConfig method annotation
  3. ReplyConfig class annotation
  4. global ReplyConfig provided in JDACommandsBuilder
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether to edit the original message or to send a new one.
    boolean
    Whether to send ephemeral replies.
    boolean
    Whether to keep the original components when editing a message.
  • Element Details

    • ephemeral

      boolean ephemeral

      Whether to send ephemeral replies. Default value is false.

      Ephemeral messages have some limitations and will be removed once the user restarts their client. Limitations:

      • Cannot contain any files/ attachments
      • Cannot be reacted to
      • Cannot be retrieved
      Returns:
      true if to send ephemeral replies
      Default:
      false
    • 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.

      Returns:
      true if to keep the original components
      Default:
      true
    • editReply

      boolean editReply

      Whether to edit the original message or to send a new one. Default value is true.

      The original message is the message, from which this event (interaction) originates. For example if this event is a ButtonEvent, the original message will be the message to which the pressed button is attached to.

      Subsequent replies to the same slash command event or the button event cannot be edited.

      Returns:
      true if to edit the original method
      Default:
      true