Interface AutoModRule
- All Superinterfaces:
ISnowflake
Rule used for auto-moderation in a
Guild
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Keyword presets that can be used ingetFilteredPresets()
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The maximum amount of whitelisted keywords inTriggerConfig.keywordFilter(String...)
.static final int
The maximum amount of whitelisted keywords inTriggerConfig.presetKeywordFilter(KeywordPreset...)
.static final int
The maximum amount of channels that can be added togetExemptChannels()
.static final int
The maximum amount of roles that can be added togetExemptRoles()
.static final int
The maximum amount of keywords inTriggerConfig.keywordFilter(String...)
.static final int
The maximum length of a keyword inTriggerConfig.keywordFilter(String...)
.static final int
The maximum limit of mentions inTriggerConfig.mentionSpam(int)
.static final int
The maximum amount of regex patterns inTriggerConfig.patternFilter(String...)
.static final int
The maximum length of a regex pattern inTriggerConfig.patternFilter(String...)
.static final int
The maximum length of a rule name. -
Method Summary
Modifier and TypeMethodDescriptiondefault AuditableRestAction<Void>
delete()
Deletes this rule.The automatedAutoModResponses
that will be activated when the rule is triggered.The whitelisted keywords that are allowed by this rule.default String
The user id of the creator of this rule.long
The user id of the creator of this rule.The type of event that triggers this rule.The channels which are exempt from the rule.The roles which are exempt from the rule.The keywords that are blocked by this rule.The keyword presets that are blocked by this rule.The regex patterns that are blocked by this rule.getGuild()
TheGuild
this rule belongs to.default AutoModRuleManager
Returns anAutoModRuleManager
, which can be used to modify this rule.int
The maximum amount of mentions that are allowed in a message.getName()
The name of this rule.The type of trigger that this rule uses.boolean
Whether this rule is enabled.boolean
Whether this rule is using the raid protection feature.Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Field Details
-
MAX_RULE_NAME_LENGTH
static final int MAX_RULE_NAME_LENGTHThe maximum length of a rule name. (100)- See Also:
-
MAX_KEYWORD_LENGTH
static final int MAX_KEYWORD_LENGTHThe maximum length of a keyword inTriggerConfig.keywordFilter(String...)
. (60)- See Also:
-
MAX_KEYWORD_AMOUNT
static final int MAX_KEYWORD_AMOUNTThe maximum amount of keywords inTriggerConfig.keywordFilter(String...)
. (1000)- See Also:
-
MAX_ALLOWLIST_CUSTOM_AMOUNT
static final int MAX_ALLOWLIST_CUSTOM_AMOUNTThe maximum amount of whitelisted keywords inTriggerConfig.keywordFilter(String...)
. (100)- See Also:
-
MAX_ALLOWLIST_PRESET_AMOUNT
static final int MAX_ALLOWLIST_PRESET_AMOUNTThe maximum amount of whitelisted keywords inTriggerConfig.presetKeywordFilter(KeywordPreset...)
. (1000)- See Also:
-
MAX_PATTERN_LENGTH
static final int MAX_PATTERN_LENGTHThe maximum length of a regex pattern inTriggerConfig.patternFilter(String...)
. (260)- See Also:
-
MAX_PATTERN_AMOUNT
static final int MAX_PATTERN_AMOUNTThe maximum amount of regex patterns inTriggerConfig.patternFilter(String...)
. (10)- See Also:
-
MAX_MENTION_LIMIT
static final int MAX_MENTION_LIMITThe maximum limit of mentions inTriggerConfig.mentionSpam(int)
. (50)- See Also:
-
MAX_EXEMPT_ROLES
static final int MAX_EXEMPT_ROLESThe maximum amount of roles that can be added togetExemptRoles()
. (20)- See Also:
-
MAX_EXEMPT_CHANNELS
static final int MAX_EXEMPT_CHANNELSThe maximum amount of channels that can be added togetExemptChannels()
. (50)- See Also:
-
-
Method Details
-
getGuild
TheGuild
this rule belongs to.- Returns:
- The guild
-
getCreatorIdLong
long getCreatorIdLong()The user id of the creator of this rule.- Returns:
- The owner id
-
getCreatorId
The user id of the creator of this rule.- Returns:
- The owner id
-
getName
The name of this rule.- Returns:
- The name
-
getEventType
The type of event that triggers this rule.- Returns:
- The event type
-
getTriggerType
The type of trigger that this rule uses.- Returns:
- The trigger type
-
isEnabled
boolean isEnabled()Whether this rule is enabled.- Returns:
- True, if enabled
-
getExemptRoles
The roles which are exempt from the rule.All members of the exempt roles will bypass the rule.
- Returns:
- The exempt roles
-
getExemptChannels
The channels which are exempt from the rule.All messages in the listed channels will bypass the rule.
- Returns:
- The exempt channels
-
getActions
The automatedAutoModResponses
that will be activated when the rule is triggered.- Returns:
- The
AutoModResponses
-
getFilteredKeywords
The keywords that are blocked by this rule.Only applies to
AutoModTriggerType.KEYWORD
.- Returns:
- The blocked keywords
-
getFilteredRegex
The regex patterns that are blocked by this rule.Only applies to
AutoModTriggerType.KEYWORD
.- Returns:
- The blocked regex patterns
-
getFilteredPresets
The keyword presets that are blocked by this rule.Only applies to
AutoModTriggerType.KEYWORD_PRESET
.- Returns:
- The blocked keyword presets
-
getAllowlist
The whitelisted keywords that are allowed by this rule.Only applies to
AutoModTriggerType.KEYWORD
andAutoModTriggerType.KEYWORD_PRESET
.- Returns:
- The whitelisted keywords
-
getMentionLimit
int getMentionLimit()The maximum amount of mentions that are allowed in a message.Only applies to
AutoModTriggerType.MENTION_SPAM
.- Returns:
- The mention limit, or 0 if this is not using
AutoModTriggerType.MENTION_SPAM
-
isMentionRaidProtectionEnabled
boolean isMentionRaidProtectionEnabled()Whether this rule is using the raid protection feature.Only applies to
AutoModTriggerType.MENTION_SPAM
.- Returns:
- True, if mention raid protection is enabled
-
getManager
Returns anAutoModRuleManager
, which can be used to modify this rule.The manager allows modifying multiple fields in a single request.
You modify multiple fields in one request by chaining setters before callingRestAction.queue()
.- Returns:
- The manager instance
- Throws:
InsufficientPermissionException
- If the currently logged in account does not have theMANAGE_SERVER
permission.
-
delete
Deletes this rule.- Returns:
RestAction
- Type:Void
- Throws:
InsufficientPermissionException
- If the currently logged in account does not have theMANAGE_SERVER
permission.
-