Table of Contents

Method CreateAutomodRuleAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

CreateAutomodRuleAsync(string, AutomodEventType, AutomodTriggerType, IEnumerable<AutomodAction>, AutomodTriggerMetadata, bool, IEnumerable<ulong>, IEnumerable<ulong>, string)

Creates a new auto mod rule in a guild.

[RequiresFeature(Features.Community)]
public Task<AutomodRule> CreateAutomodRuleAsync(string name, AutomodEventType eventType, AutomodTriggerType triggerType, IEnumerable<AutomodAction> actions, AutomodTriggerMetadata triggerMetadata = null, bool enabled = false, IEnumerable<ulong> exemptRoles = null, IEnumerable<ulong> exemptChannels = null, string reason = null)

Parameters

name string

The name of the rule.

eventType AutomodEventType

The event type of the rule.

triggerType AutomodTriggerType

The trigger type of the rule.

actions IEnumerable<AutomodAction>

The actions of the rule.

triggerMetadata AutomodTriggerMetadata

The meta data of the rule.

enabled bool

Whether this rule is enabled.

exemptRoles IEnumerable<ulong>

The exempt roles of the rule.

exemptChannels IEnumerable<ulong>

The exempt channels of the rule.

reason string

The reason for this addition

Returns

Task<AutomodRule>

The created rule.

Exceptions

UnauthorizedException

Thrown when the client does not have the ManageGuild permission.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.