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
stringThe name of the rule.
eventType
AutomodEventTypeThe event type of the rule.
triggerType
AutomodTriggerTypeThe trigger type of the rule.
actions
IEnumerable<AutomodAction>The actions of the rule.
triggerMetadata
AutomodTriggerMetadataThe meta data of the rule.
enabled
boolWhether this rule is enabled.
exemptRoles
IEnumerable<ulong>The exempt roles of the rule.
exemptChannels
IEnumerable<ulong>The exempt channels of the rule.
reason
stringThe 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.