Interface AutoModResponse

All Superinterfaces:
SerializableData

public interface AutoModResponse extends SerializableData
An automated response to an AutoModRule.
  • Field Details

    • MAX_CUSTOM_MESSAGE_LENGTH

      static final int MAX_CUSTOM_MESSAGE_LENGTH
      The maximum length of a custom message. (150)
      See Also:
  • Method Details

    • getType

      The type of response.
      Returns:
      The type of response
    • getChannel

      The channel to send the alert message to.
      Returns:
      The channel to send the alert message to, or null if this is not a AutoModResponse.Type.SEND_ALERT_MESSAGE response
    • getCustomMessage

      @Nullable String getCustomMessage()
      The custom message to send to the user.
      Returns:
      The custom message to send to the user, or null if this is not a AutoModResponse.Type.BLOCK_MESSAGE response
    • getTimeoutDuration

      @Nullable Duration getTimeoutDuration()
      The duration to timeout the user for.
      Returns:
      The duration to timeout the user for, or null if this is not a AutoModResponse.Type.TIMEOUT response
    • blockMessage

      @Nonnull static AutoModResponse blockMessage()
      Create a response that will block the message.

      You can optionally pass a custom message to send to the user.

      Returns:
      The response instance
      See Also:
    • blockMessage

      @Nonnull static AutoModResponse blockMessage(@Nullable String customMessage)
      Create a response that will block the message.
      Parameters:
      customMessage - The custom message to send to the user, or null to send the default message
      Returns:
      The response instance
      Throws:
      IllegalArgumentException - If the provided custom message is longer than 150 characters
    • sendAlert

      Create a response that will send an alert message to the specified channel.
      Parameters:
      channel - The channel to send the alert message to
      Returns:
      The response instance
      Throws:
      IllegalArgumentException - If the provided channel is null
    • timeoutMember

      @Nonnull static AutoModResponse timeoutMember(@Nonnull Duration duration)
      Create a response that will timeout the user for the specified duration.

      To create a rule with this response, the creator must also have the MODERATE_MEMBERS permission.

      Parameters:
      duration - The duration to timeout the user for
      Returns:
      The response instance
      Throws:
      IllegalArgumentException - If the provided duration is not positive or longer than 28 days
    • blockMemberInteraction

      @Nonnull @Incubating static AutoModResponse blockMemberInteraction()
      Create a response that will prevent the member from interacting with anything in the guild until the offending content is removed.
      Returns:
      The response instance
      Incubating:
      This has not been officially released yet