Method CreateGuildAutoModerationRuleAsync
- Namespace
- DSharpPlus.Net
- Assembly
- DSharpPlus.dll
CreateGuildAutoModerationRuleAsync(ulong, string, DiscordRuleEventType, DiscordRuleTriggerType, DiscordRuleTriggerMetadata, IReadOnlyList<DiscordAutoModerationAction>, Optional<bool>, Optional<IReadOnlyList<DiscordRole>>, Optional<IReadOnlyList<DiscordChannel>>, string?)
Internal method to create an auto-moderation rule in a guild.
public ValueTask<DiscordAutoModerationRule> CreateGuildAutoModerationRuleAsync(ulong guildId, string name, DiscordRuleEventType eventType, DiscordRuleTriggerType triggerType, DiscordRuleTriggerMetadata triggerMetadata, IReadOnlyList<DiscordAutoModerationAction> actions, Optional<bool> enabled = default, Optional<IReadOnlyList<DiscordRole>> exemptRoles = default, Optional<IReadOnlyList<DiscordChannel>> exemptChannels = default, string? reason = null)
Parameters
guildIdulongThe id of the guild where the rule will be created.
namestringThe rule name.
eventTypeDiscordRuleEventTypeThe Discord event that will trigger the rule.
triggerTypeDiscordRuleTriggerTypeThe rule trigger.
triggerMetadataDiscordRuleTriggerMetadataThe trigger metadata.
actionsIReadOnlyList<DiscordAutoModerationAction>The actions that will run when a rule is triggered.
enabledOptional<bool>Whenever the rule is enabled or not.
exemptRolesOptional<IReadOnlyList<DiscordRole>>The exempted roles that will not trigger the rule.
exemptChannelsOptional<IReadOnlyList<DiscordChannel>>The exempted channels that will not trigger the rule.
reasonstringThe reason for audits logs.
Returns
- ValueTask<DiscordAutoModerationRule>
The created rule.