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
namestringThe name of the rule.
eventTypeAutomodEventTypeThe event type of the rule.
triggerTypeAutomodTriggerTypeThe trigger type of the rule.
actionsIEnumerable<AutomodAction>The actions of the rule.
triggerMetadataAutomodTriggerMetadataThe meta data of the rule.
enabledboolWhether this rule is enabled.
exemptRolesIEnumerable<ulong>The exempt roles of the rule.
exemptChannelsIEnumerable<ulong>The exempt channels of the rule.
reasonstringThe 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.