Interface AutoModResponse
- All Superinterfaces:
SerializableData
An automated response to an
AutoModRule.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum length of a custom message. -
Method Summary
Modifier and TypeMethodDescriptionstatic AutoModResponseCreate a response that will prevent the member from interacting with anything in the guild until the offending content is removed.static AutoModResponseCreate a response that will block the message.static AutoModResponseblockMessage(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 AutoModResponsesendAlert(GuildMessageChannel channel) Create a response that will send an alert message to the specified channel.static AutoModResponsetimeoutMember(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_MESSAGEresponse
-
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_MESSAGEresponse
-
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.TIMEOUTresponse
-
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_MEMBERSpermission.- 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
-