Interface AutoModResponse
- All Superinterfaces:
SerializableData
An automated response to an
AutoModRule
.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum length of a custom message. -
Method Summary
Modifier and TypeMethodDescriptionstatic AutoModResponse
Create a response that will prevent the member from interacting with anything in the guild until the offending content is removed.static AutoModResponse
Create a response that will block the message.static AutoModResponse
blockMessage
(String customMessage) Create a response that will block the message.The channel to send the alert message to.The custom message to send to the user.The duration to timeout the user for.getType()
The type of response.static AutoModResponse
sendAlert
(GuildMessageChannel channel) Create a response that will send an alert message to the specified channel.static AutoModResponse
timeoutMember
(Duration duration) Create a response that will timeout the user for the specified duration.Methods inherited from interface net.dv8tion.jda.api.utils.data.SerializableData
toData
-
Field Details
-
MAX_CUSTOM_MESSAGE_LENGTH
static final int MAX_CUSTOM_MESSAGE_LENGTHThe 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
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
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
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
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 isnull
-
timeoutMember
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
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
-