AutomoderationRuleBuilder
AutomoderationRuleBuilder is used to construct an auto-moderation rule for a Discord guild, including trigger types, actions, and exempt roles or channels.
Usage:
Properties
EventType
AutomoderationRuleBuilder.EventType :: table
An enumeration of event types.
- MessageSend: 1
TriggerType
AutomoderationRuleBuilder.TriggerType :: table
An enumeration of trigger types.
- Keyword: 1
- Spam: 3
- KeywordPreset: 4
- MentionSpam: 5
KeywordPresets
AutomoderationRuleBuilder.KeywordPresets :: table
An enumeration of keyword presets.
- Profanity: 1
- SexualContent: 2
- Slurs: 3
ActionType
AutomoderationRuleBuilder.ActionType :: table
An enumeration of action types.
- BlockMessage: 1
- SendAlertMessage: 2
- Timeout: 3
Methods
setName
AutomoderationRuleBuilder : setName () -> Builders.AutomoderationRuleBuilder
name: string
Sets the name of the rule.
setEventType
AutomoderationRuleBuilder : setEventType () -> Builders.AutomoderationRuleBuilder
eventType: number
Sets the event type for the rule.
setTriggerType
AutomoderationRuleBuilder : setTriggerType () -> Builders.AutomoderationRuleBuilder
triggerType: number
Sets the trigger type for the rule.
setTriggerMetadata
AutomoderationRuleBuilder : setTriggerMetadata () -> Builders.AutomoderationRuleBuilder
triggerMetadata: table
Sets the trigger metadata for the rule.
addAction
AutomoderationRuleBuilder : addAction () -> Builders.AutomoderationRuleBuilder
actionType: number
actionMetadata: table
Adds an action to the rule.
setEnabled
AutomoderationRuleBuilder : setEnabled () -> Builders.AutomoderationRuleBuilder
enabled: boolean
Sets whether the rule is enabled.
addExemptRole
AutomoderationRuleBuilder : addExemptRole () -> Builders.AutomoderationRuleBuilder
roleId: string
Adds an exempt role to the rule.
addExemptChannel
AutomoderationRuleBuilder : addExemptChannel () -> Builders.AutomoderationRuleBuilder
channelId: string
Adds an exempt channel to the rule.
toPayloadObject
AutomoderationRuleBuilder : toPayloadObject () -> Network.Resolvable
Converts the rule to a JSON object that can be sent to the Discord API.
Functions
new
AutomoderationRuleBuilder . new () -> ()
Creates a new instance of AutomoderationRuleBuilder.