Class AutoModRuleManagerImpl
java.lang.Object
net.dv8tion.jda.internal.requests.RestActionImpl<Void>
net.dv8tion.jda.internal.requests.restaction.AuditableRestActionImpl<Void>
net.dv8tion.jda.internal.managers.ManagerBase<AutoModRuleManager>
net.dv8tion.jda.internal.managers.AutoModRuleManagerImpl
- All Implemented Interfaces:
AutoModRuleManager
,Manager<AutoModRuleManager>
,RestAction<Void>
,AuditableRestAction<Void>
public class AutoModRuleManagerImpl
extends ManagerBase<AutoModRuleManager>
implements AutoModRuleManager
-
Field Summary
Fields inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
LOG
Fields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
Fields inherited from interface net.dv8tion.jda.api.managers.AutoModRuleManager
ENABLED, EXEMPT_CHANNELS, EXEMPT_ROLES, NAME, RESPONSE, TRIGGER_METADATA
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetEnabled
(boolean enabled) Sets the enabled state of the selectedAutoModRule
.setExemptChannels
(Collection<? extends GuildChannel> channels) Set which channels can bypass this rule.setExemptRoles
(Collection<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.setTriggerConfig
(TriggerConfig config) Change theTriggerConfig
for this rule.Methods inherited from class net.dv8tion.jda.internal.managers.ManagerBase
complete, deadline, isPermissionChecksEnabled, queue, reset, reset, reset, setCheck, setPermissionChecksEnabled, timeout
Methods inherited from class net.dv8tion.jda.internal.requests.restaction.AuditableRestActionImpl
reason
Methods inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
getCheck, getDefaultFailure, getDefaultSuccess, getDefaultTimeout, getJDA, handleResponse, isPassContext, priority, setDefaultFailure, setDefaultSuccess, setDefaultTimeout, setErrorMapper, setPassContext, submit
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.managers.AutoModRuleManager
reset, reset, setExemptChannels, setExemptRoles, setResponses
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, 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
-
Constructor Details
-
AutoModRuleManagerImpl
-
-
Method Details
-
setName
Description copied from interface:AutoModRuleManager
Sets the name of the selectedAutoModRule
.A rule name must be between 1-100 characters long!
- Specified by:
setName
in interfaceAutoModRuleManager
- Parameters:
name
- The new name for the selectedAutoModRule
- Returns:
- AutoModRuleManager for chaining convenience
-
setEnabled
Description copied from interface:AutoModRuleManager
Sets the enabled state of the selectedAutoModRule
.When a rule is disabled, it will not be applied to any messages.
- Specified by:
setEnabled
in interfaceAutoModRuleManager
- Parameters:
enabled
- True, if the selectedAutoModRule
should be enabled- Returns:
- AutoModRuleManager for chaining convenience
-
setResponses
@Nonnull public AutoModRuleManager setResponses(@Nonnull Collection<? extends AutoModResponse> responses) Description copied from interface:AutoModRuleManager
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.
- Specified by:
setResponses
in interfaceAutoModRuleManager
- Parameters:
responses
- The responses to configure- Returns:
- AutoModRuleManager for chaining convenience
-
setExemptRoles
Description copied from interface:AutoModRuleManager
Set which roles can bypass this rule.Roles added to the exemptions will allow all of its members to bypass this rule.
- Specified by:
setExemptRoles
in interfaceAutoModRuleManager
- Parameters:
roles
- The roles to exempt (up to 20 roles)- Returns:
- AutoModRuleManager for chaining convenience
-
setExemptChannels
@Nonnull public AutoModRuleManager setExemptChannels(@Nonnull Collection<? extends GuildChannel> channels) Description copied from interface:AutoModRuleManager
Set which channels can bypass this rule.No messages sent in this channel will trigger the rule.
- Specified by:
setExemptChannels
in interfaceAutoModRuleManager
- Parameters:
channels
- The channels to add (up to 50 channels)- Returns:
- AutoModRuleManager for chaining convenience
-
setTriggerConfig
Description copied from interface:AutoModRuleManager
Change theTriggerConfig
for this rule.- Specified by:
setTriggerConfig
in interfaceAutoModRuleManager
- Parameters:
config
- The new config- Returns:
- AutoModRuleManager for chaining convenience
-