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
Additional data used to determine if the rule should triggered.
Characters the type of content which triggered the rule
Types
@type actions() :: [Nostrum.Struct.AutoModerationRule.Action.t()]
A list of Actions which will be performed when the rule is triggered.
@type creator_id() :: Nostrum.Struct.User.id()
The id of the user who created the rule
@type enabled() :: boolean()
If the rule is enabled or not.
@type event_type() :: 1
Indicates in what event context a rule should be checked
value | type | description | |
---- | ---- | ----------- | |
1 | MESSAGE_SEND | when a member sends or edits a message in a guild |
@type exempt_channels() :: [Nostrum.Struct.Channel.id()]
A list of channels that are exempt from the rule
@type exempt_roles() :: [Nostrum.Struct.Guild.Role.id()]
A list of roles that are exempt from the rule.
@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
@type preset_values() :: 1..3
Values which represent the different presets defined by Discord
value | type | description | |
---- | ---- | ----------- | |
1 | PROFANITY | Words which may be considered profane | |
2 | HARMFUL_LINK | Words that refer to sexually explicit behavior or activity | |
3 | SLURS | Personal 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() }
@type trigger_metadata() :: Nostrum.Struct.AutoModerationRule.TriggerMetadata.t()
Additional data used to determine if the rule should triggered.
The trigger_type/0
field will determine which of the following fields are present.
key | associated trigger_type | |
---- | ----------- | |
keywords | KEYWORD | |
preset | KEYWORD_PRESET |
@type trigger_type() :: 1..4
Characters the type of content which triggered the rule
value | type | max per guild | description | |
---- | ---- | ----- | ----------- | |
1 | KEYWORD | 3 | check if content contains words from a user defined list of keywords | |
2 | HARMFUL_LINK | 1 | check if the content contains any harmful links | |
3 | SPAM | 1 | check if the content represents generic spam | |
4 | KEYWORD_PRESET | 1 | check 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.