View Source Nostrum.Struct.AutoModerationRule (Nostrum v0.10.0)

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

Link to this type

actions()

View Source (since 0.7.0)

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

Link to this type

creator_id()

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

The id of the user who created the rule

Link to this type

enabled()

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

If the rule is enabled or not.

Link to this type

event_type()

View Source (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
Link to this type

exempt_channels()

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

A list of channels that are exempt from the rule

Link to this type

exempt_roles()

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

A list of roles that are exempt from the rule.

Link to this type

guild_id()

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

The id of the guild the rule belongs to

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

The id of the auto-moderation rule

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

The name of the rule

Link to this type

preset_values()

View Source (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
2HARMFUL_LINKWords that refer to sexually explicit behavior or activity
3SLURSPersonal insults or words that may be considered hate speech
@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()
}
Link to this type

trigger_metadata()

View Source (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
Link to this type

trigger_type()

View Source (since 0.7.0)
@type trigger_type() :: 1..4

Characters the type of content which triggered the rule

valuetypemax per guilddescription
------------------------
1​KEYWORD3check if content contains words from a user defined list of keywords
2HARMFUL_LINK1check if the content contains any harmful links
3SPAM1check if the content represents generic spam
4KEYWORD_PRESET1check if the content contains a list of discord defined keywords

note: HARMFUL_LINK and SPAM are not yet offically released at the time of this writing.