Class AutoModRuleImpl
java.lang.Object
net.dv8tion.jda.internal.entities.automod.AutoModRuleImpl
- All Implemented Interfaces:
AutoModRule
,ISnowflake
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.automod.AutoModRule
AutoModRule.KeywordPreset
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.automod.AutoModRule
MAX_ALLOWLIST_CUSTOM_AMOUNT, MAX_ALLOWLIST_PRESET_AMOUNT, MAX_EXEMPT_CHANNELS, MAX_EXEMPT_ROLES, MAX_KEYWORD_AMOUNT, MAX_KEYWORD_LENGTH, MAX_MENTION_LIMIT, MAX_PATTERN_AMOUNT, MAX_PATTERN_LENGTH, MAX_RULE_NAME_LENGTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static AutoModRuleImpl
fromData
(Guild guild, DataObject data) The automatedAutoModResponses
that will be activated when the rule is triggered.The whitelisted keywords that are allowed by 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.long
The Snowflake id of this entity.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.int
hashCode()
boolean
Whether this rule is enabled.boolean
Whether this rule is using the raid protection feature.setActions
(List<AutoModResponse> actions) setAllowlist
(List<String> allowlist) setEnabled
(boolean enabled) setEventType
(AutoModEventType eventType) setExemptChannels
(gnu.trove.list.TLongList exemptChannels) setExemptRoles
(gnu.trove.list.TLongList exemptRoles) setFilteredKeywords
(List<String> filteredKeywords) setFilteredPresets
(EnumSet<AutoModRule.KeywordPreset> filteredPresets) setFilteredRegex
(List<String> filteredRegex) setMentionLimit
(int mentionLimit) setMentionRaidProtectionEnabled
(boolean mentionRaidProtectionEnabled) setOwnerId
(long ownerId) setTriggerType
(AutoModTriggerType triggerType) toString()
Methods inherited from interface net.dv8tion.jda.api.entities.automod.AutoModRule
delete, getCreatorId, getManager
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
AutoModRuleImpl
-
-
Method Details
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getGuild
Description copied from interface:AutoModRule
TheGuild
this rule belongs to.- Specified by:
getGuild
in interfaceAutoModRule
- Returns:
- The guild
-
getCreatorIdLong
public long getCreatorIdLong()Description copied from interface:AutoModRule
The user id of the creator of this rule.- Specified by:
getCreatorIdLong
in interfaceAutoModRule
- Returns:
- The owner id
-
getName
Description copied from interface:AutoModRule
The name of this rule.- Specified by:
getName
in interfaceAutoModRule
- Returns:
- The name
-
getEventType
Description copied from interface:AutoModRule
The type of event that triggers this rule.- Specified by:
getEventType
in interfaceAutoModRule
- Returns:
- The event type
-
getTriggerType
Description copied from interface:AutoModRule
The type of trigger that this rule uses.- Specified by:
getTriggerType
in interfaceAutoModRule
- Returns:
- The trigger type
-
isEnabled
public boolean isEnabled()Description copied from interface:AutoModRule
Whether this rule is enabled.- Specified by:
isEnabled
in interfaceAutoModRule
- Returns:
- True, if enabled
-
getExemptRoles
Description copied from interface:AutoModRule
The roles which are exempt from the rule.All members of the exempt roles will bypass the rule.
- Specified by:
getExemptRoles
in interfaceAutoModRule
- Returns:
- The exempt roles
-
getExemptChannels
Description copied from interface:AutoModRule
The channels which are exempt from the rule.All messages in the listed channels will bypass the rule.
- Specified by:
getExemptChannels
in interfaceAutoModRule
- Returns:
- The exempt channels
-
getActions
Description copied from interface:AutoModRule
The automatedAutoModResponses
that will be activated when the rule is triggered.- Specified by:
getActions
in interfaceAutoModRule
- Returns:
- The
AutoModResponses
-
getFilteredKeywords
Description copied from interface:AutoModRule
The keywords that are blocked by this rule.Only applies to
AutoModTriggerType.KEYWORD
.- Specified by:
getFilteredKeywords
in interfaceAutoModRule
- Returns:
- The blocked keywords
-
getFilteredRegex
Description copied from interface:AutoModRule
The regex patterns that are blocked by this rule.Only applies to
AutoModTriggerType.KEYWORD
.- Specified by:
getFilteredRegex
in interfaceAutoModRule
- Returns:
- The blocked regex patterns
-
getFilteredPresets
Description copied from interface:AutoModRule
The keyword presets that are blocked by this rule.Only applies to
AutoModTriggerType.KEYWORD_PRESET
.- Specified by:
getFilteredPresets
in interfaceAutoModRule
- Returns:
- The blocked keyword presets
-
getAllowlist
Description copied from interface:AutoModRule
The whitelisted keywords that are allowed by this rule.Only applies to
AutoModTriggerType.KEYWORD
andAutoModTriggerType.KEYWORD_PRESET
.- Specified by:
getAllowlist
in interfaceAutoModRule
- Returns:
- The whitelisted keywords
-
getMentionLimit
public int getMentionLimit()Description copied from interface:AutoModRule
The maximum amount of mentions that are allowed in a message.Only applies to
AutoModTriggerType.MENTION_SPAM
.- Specified by:
getMentionLimit
in interfaceAutoModRule
- Returns:
- The mention limit, or 0 if this is not using
AutoModTriggerType.MENTION_SPAM
-
isMentionRaidProtectionEnabled
public boolean isMentionRaidProtectionEnabled()Description copied from interface:AutoModRule
Whether this rule is using the raid protection feature.Only applies to
AutoModTriggerType.MENTION_SPAM
.- Specified by:
isMentionRaidProtectionEnabled
in interfaceAutoModRule
- Returns:
- True, if mention raid protection is enabled
-
setName
-
setEnabled
-
setOwnerId
-
setEventType
-
setTriggerType
-
setExemptRoles
-
setExemptChannels
-
setActions
-
setFilteredKeywords
-
setFilteredRegex
-
setFilteredPresets
-
setAllowlist
-
setMentionLimit
-
setMentionRaidProtectionEnabled
-
hashCode
public int hashCode() -
equals
-
toString
-
fromData
-