Table of Contents

Class SocketAutoModRule

Namespace
Discord.WebSocket
Assembly
Discord.Net.WebSocket.dll
public class SocketAutoModRule : SocketEntity<ulong>, IAutoModRule, ISnowflakeEntity, IEntity<ulong>, IDeletable
Inheritance
SocketAutoModRule
Implements
Inherited Members

Properties

Actions

Gets a collection of actions that will be preformed if a user breaks this rule.

public IReadOnlyCollection<AutoModRuleAction> Actions { get; }

Property Value

IReadOnlyCollection<AutoModRuleAction>

AllowList

Gets the allow list patterns for this rule. Empty if the rule has no allowed terms.

public IReadOnlyCollection<string> AllowList { get; }

Property Value

IReadOnlyCollection<string>

Remarks

This collection will be empty if TriggerType is not Keyword.

CreatedAt

Gets when the snowflake was created.

public DateTimeOffset CreatedAt { get; }

Property Value

DateTimeOffset

A DateTimeOffset representing when the entity was first created.

Creator

Gets the creator of this rule.

public SocketGuildUser Creator { get; }

Property Value

SocketGuildUser

Enabled

Gets whether or not this rule is enabled.

public bool Enabled { get; }

Property Value

bool

EventType

Gets the event type on which this rule is triggered.

public AutoModEventType EventType { get; }

Property Value

AutoModEventType

ExemptChannels

Gets the channels that are exempt from this rule.

public IReadOnlyCollection<SocketGuildChannel> ExemptChannels { get; }

Property Value

IReadOnlyCollection<SocketGuildChannel>

ExemptRoles

Gets the roles that are exempt from this rule.

public IReadOnlyCollection<SocketRole> ExemptRoles { get; }

Property Value

IReadOnlyCollection<SocketRole>

Guild

Gets the guild that this rule is in.

public SocketGuild Guild { get; }

Property Value

SocketGuild

KeywordFilter

Gets the keyword filter for this rule.

public IReadOnlyCollection<string> KeywordFilter { get; }

Property Value

IReadOnlyCollection<string>

Remarks

This collection will be empty if TriggerType is not Keyword.

MentionTotalLimit

Gets the total mention limit for this rule.

public int? MentionTotalLimit { get; }

Property Value

int?

Remarks

This property will be null if TriggerType is not MentionSpam.

Name

Get the name of this rule.

public string Name { get; }

Property Value

string

Presets

Gets the preset keyword types for this rule. Empty if the rule has no presets.

public IReadOnlyCollection<KeywordPresetTypes> Presets { get; }

Property Value

IReadOnlyCollection<KeywordPresetTypes>

Remarks

This collection will be empty if TriggerType is not KeywordPreset.

RegexPatterns

Gets regex patterns for this rule. Empty if the rule has no regexes.

public IReadOnlyCollection<string> RegexPatterns { get; }

Property Value

IReadOnlyCollection<string>

Remarks

This collection will be empty if TriggerType is not Keyword.

TriggerType

Gets the trigger type on which this rule executes.

public AutoModTriggerType TriggerType { get; }

Property Value

AutoModTriggerType

Methods

DeleteAsync(RequestOptions)

Deletes this object and all its children.

public Task DeleteAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

ModifyAsync(Action<AutoModRuleProperties>, RequestOptions)

Modifies this rule.

public Task ModifyAsync(Action<AutoModRuleProperties> func, RequestOptions options = null)

Parameters

func Action<AutoModRuleProperties>

The delegate containing the properties to modify the rule with.

options RequestOptions

The options to be used when sending the request.

Returns

Task