Nostrum.Struct.AutoModerationRule (nostrum v0.11.0-dev)

View Source

Struct representing an auto-moderation rule.

Summary

Types

A list of Actions which will be performed when the rule is triggered.

The id of the user who created the rule

If the rule is enabled or not.

Indicates in what event context a rule should be checked

A list of channels that are exempt from the rule

A list of roles that are exempt from the rule.

The id of the guild the rule belongs to

The id of the auto-moderation rule

The name of the rule

Values which represent the different presets defined by Discord

t()

Additional data used to determine if the rule should triggered.

Characters the type of content which triggered the rule

Types

actions()

(since 0.7.0)

A list of Actions which will be performed when the rule is triggered.

creator_id()

(since 0.7.0)
@type creator_id() :: Nostrum.Struct.User.id()

The id of the user who created the rule

enabled()

(since 0.7.0)
@type enabled() :: boolean()

If the rule is enabled or not.

event_type()

(since 0.7.0)
@type event_type() :: 1

Indicates in what event context a rule should be checked

valuetypedescription
-------------------
1MESSAGE_SENDwhen a member sends or edits a message in a guild

exempt_channels()

(since 0.7.0)
@type exempt_channels() :: [Nostrum.Struct.Channel.id()]

A list of channels that are exempt from the rule

exempt_roles()

(since 0.7.0)
@type exempt_roles() :: [Nostrum.Struct.Guild.Role.id()]

A list of roles that are exempt from the rule.

guild_id()

(since 0.7.0)
@type guild_id() :: Nostrum.Struct.Guild.id()

The id of the guild the rule belongs to

id()

(since 0.7.0)
@type id() :: Nostrum.Snowflake.t()

The id of the auto-moderation rule

name()

(since 0.7.0)
@type name() :: String.t()

The name of the rule

preset_values()

(since 0.7.0)
@type preset_values() :: 1..3

Values which represent the different presets defined by Discord

valuetypedescription
-------------------
1PROFANITYWords which may be considered profane
2SEXUAL_CONTENTWords that refer to sexually explicit behavior or activity
3SLURSPersonal insults or words that may be considered hate speech

t()

(since 0.7.0)
@type t() :: %Nostrum.Struct.AutoModerationRule{
  actions: actions(),
  creator_id: creator_id(),
  enabled: enabled(),
  event_type: event_type(),
  exempt_channels: exempt_channels(),
  exempt_roles: exempt_roles(),
  guild_id: guild_id(),
  id: id(),
  name: name(),
  trigger_metadata: trigger_metadata(),
  trigger_type: trigger_type()
}

trigger_metadata()

(since 0.7.0)

Additional data used to determine if the rule should triggered.

The trigger_type/0 field will determine which of the following fields are present.

keyassociated trigger_type
---------------
keywords​KEYWORD
presetKEYWORD_PRESET

trigger_type()

(since 0.7.0)
@type trigger_type() :: 1 | 3..6

Characters the type of content which triggered the rule

valuetypemax per guilddescription
------------------------
1​KEYWORD6check if content contains words from a user defined list of keywords
3SPAM1check if the content represents generic spam
4KEYWORD_PRESET1check if the content contains a list of discord defined keywords
5MENTION_SPAM1check if content contains more unique mentions than allowed
6MEMBER_PROFILE1check if member profile contains words from a user defined list of keywords