Package net.dv8tion.jda.api.managers
Interface AutoModRuleManager
- All Superinterfaces:
- AuditableRestAction<Void>,- Manager<AutoModRuleManager>,- RestAction<Void>
Manager providing functionality to update one or more fields for an 
AutoModRule.
 Example
 manager.setName("Discord Invites")
        .setEnables(false)
        .queue();
 manager.reset(AutoModRuleManager.NAME | AutoModRuleManager.ENABLED)
        .setName("Invites")
        .setEnabled(true)
        .queue();
 - 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final longUsed to reset the enabled field.static final longUsed to reset the exempt channels field.static final longUsed to reset the exempt roles field.static final longUsed to reset the name field.static final longUsed to reset the response field.static final longUsed to reset the trigger metadata field.Fields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestActionMAX_REASON_LENGTH
- 
Method SummaryModifier and TypeMethodDescriptionreset(long fields) Resets the fields specified by the provided bit-flag pattern.reset(long... fields) Resets the fields specified by the provided bit-flag pattern.setEnabled(boolean enabled) Sets the enabled state of the selectedAutoModRule.setExemptChannels(Collection<? extends GuildChannel> channels) Set which channels can bypass this rule.default AutoModRuleManagersetExemptChannels(GuildChannel... channels) Set which channels can bypass this rule.setExemptRoles(Collection<Role> roles) Set which roles can bypass this rule.default AutoModRuleManagersetExemptRoles(Role... roles) Set which roles can bypass this rule.Sets the name of the selectedAutoModRule.setResponses(Collection<? extends AutoModResponse> responses) Sets what the rule should do upon triggering.default AutoModRuleManagersetResponses(AutoModResponse... responses) Sets what the rule should do upon triggering.setTriggerConfig(TriggerConfig config) Change theTriggerConfigfor this rule.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestActionreasonMethods inherited from interface net.dv8tion.jda.api.managers.Managerdeadline, reset, setCheck, timeoutMethods inherited from interface net.dv8tion.jda.api.requests.RestActionaddCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
- 
Field Details- 
NAMEstatic final long NAMEUsed to reset the name field.- See Also:
 
- 
ENABLEDstatic final long ENABLEDUsed to reset the enabled field.- See Also:
 
- 
RESPONSEstatic final long RESPONSEUsed to reset the response field.- See Also:
 
- 
EXEMPT_ROLESstatic final long EXEMPT_ROLESUsed to reset the exempt roles field.- See Also:
 
- 
EXEMPT_CHANNELSstatic final long EXEMPT_CHANNELSUsed to reset the exempt channels field.- See Also:
 
- 
TRIGGER_METADATAstatic final long TRIGGER_METADATAUsed to reset the trigger metadata field.- See Also:
 
 
- 
- 
Method Details- 
resetResets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
 Example:manager.reset(AutoModRuleManager.NAME | AutoModRuleManager.RESPONSE);Flag Constants: - Specified by:
- resetin interface- Manager<AutoModRuleManager>
- Parameters:
- fields- Integer value containing the flags to reset.
- Returns:
- AutoModRuleManager for chaining convenience
 
- 
resetResets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
 Example:manager.reset(AutoModRuleManager.NAME, AutoModRuleManager.RESPONSE);Flag Constants: - Specified by:
- resetin interface- Manager<AutoModRuleManager>
- Parameters:
- fields- Integer value containing the flags to reset.
- Returns:
- AutoModRuleManager for chaining convenience
 
- 
setNameSets the name of the selectedAutoModRule.A rule name must be between 1-100 characters long! - Parameters:
- name- The new name for the selected- AutoModRule
- Returns:
- AutoModRuleManager for chaining convenience
- Throws:
- IllegalArgumentException- If the provided name is- nullor not between 1-100 characters long
 
- 
setEnabledSets the enabled state of the selectedAutoModRule.When a rule is disabled, it will not be applied to any messages. - Parameters:
- enabled- True, if the selected- AutoModRuleshould be enabled
- Returns:
- AutoModRuleManager for chaining convenience
 
- 
setResponses@Nonnull @CheckReturnValue AutoModRuleManager setResponses(@Nonnull Collection<? extends AutoModResponse> responses) Sets what the rule should do upon triggering.Note that each response type can only be used once. If multiple responses of the same type are provided, the last one is used. - Parameters:
- responses- The responses to configure
- Returns:
- AutoModRuleManager for chaining convenience
- Throws:
- IllegalArgumentException-- If nullorAutoModResponse.Type.UNKNOWNis provided
- If the collection is empty
 
- If 
 
- 
setResponses@Nonnull @CheckReturnValue default AutoModRuleManager setResponses(@Nonnull AutoModResponse... responses) Sets what the rule should do upon triggering.Note that each response type can only be used once. If multiple responses of the same type are provided, the last one is used. - Parameters:
- responses- The responses to configure
- Returns:
- AutoModRuleManager for chaining convenience
- Throws:
- IllegalArgumentException-- If nullorAutoModResponse.Type.UNKNOWNis provided
- If the collection is empty
 
- If 
 
- 
setExemptRolesSet which roles can bypass this rule.Roles added to the exemptions will allow all of its members to bypass this rule. - Parameters:
- roles- The roles to exempt (up to 20 roles)
- Returns:
- AutoModRuleManager for chaining convenience
- Throws:
- IllegalArgumentException- If null is provided or the number of roles exceeds 20
 
- 
setExemptRolesSet which roles can bypass this rule.Roles added to the exemptions will allow all of its members to bypass this rule. - Parameters:
- roles- The roles to exempt (up to 20 roles)
- Returns:
- AutoModRuleManager for chaining convenience
- Throws:
- IllegalArgumentException- If null is provided or the number of roles exceeds 20
 
- 
setExemptChannels@Nonnull @CheckReturnValue AutoModRuleManager setExemptChannels(@Nonnull Collection<? extends GuildChannel> channels) Set which channels can bypass this rule.No messages sent in this channel will trigger the rule. - Parameters:
- channels- The channels to add (up to 50 channels)
- Returns:
- AutoModRuleManager for chaining convenience
- Throws:
- IllegalArgumentException- If null is provided or the number of channels exceeds 50
 
- 
setExemptChannels@Nonnull @CheckReturnValue default AutoModRuleManager setExemptChannels(@Nonnull GuildChannel... channels) Set which channels can bypass this rule.No messages sent in this channel will trigger the rule. - Parameters:
- channels- The channels to add (up to 50 channels)
- Returns:
- AutoModRuleManager for chaining convenience
- Throws:
- IllegalArgumentException- If null is provided or the number of channels exceeds 50
 
- 
setTriggerConfigChange theTriggerConfigfor this rule.- Parameters:
- config- The new config
- Returns:
- AutoModRuleManager for chaining convenience
- Throws:
- IllegalArgumentException- If null is provided
 
 
-