diff --git a/docs/Change_Log.md b/docs/Change_Log.md index ad261a26c1..23b7b1deba 100644 --- a/docs/Change_Log.md +++ b/docs/Change_Log.md @@ -1,5 +1,15 @@ # Change Log +## Auto Moderation + +#### Jun 16, 2022 + +Add new [Auto Moderation feature](#DOCS_RESOURCES_AUTO_MODERATION) which enables guilds to moderate message content based on keywords, harmful links, and unwanted spam. This change includes: +- New endpoints for [creating](#DOCS_RESOURCES_AUTO_MODERATION/create-auto-moderation-rule), [updating](#DOCS_RESOURCES_AUTO_MODERATION/modify-auto-moderation-rule), and [deleting](#DOCS_RESOURCES_AUTO_MODERATION/delete-auto-moderation-rule) Auto Moderation rules +- New gateway events emitted when Auto Moderation rules are [created](#DOCS_TOPICS_GATEWAY/auto-moderation-rule-create) (`AUTO_MODERATION_RULE_CREATE`), [updated](#DOCS_TOPICS_GATEWAY/auto-moderation-rule-update) (`AUTO_MODERATION_RULE_UPDATE `), and [deleted](#DOCS_TOPICS_GATEWAY/auto-moderation-rule-delete) (`AUTO_MODERATION_RULE_DELETE `). Requires the `AUTO_MODERATION_CONFIGURATION` (`1 << 20`) intent +- New gateway event emitted when an [action is executed](#DOCS_TOPICS_GATEWAY/auto-moderation-action-execution) (`AUTO_MODERATION_ACTION_EXECUTION`). Requires the `AUTO_MODERATION_EXECUTION` (`1 << 21`) intent +- New [audit log entries](#DOCS_RESOURCES_AUDIT_LOG/audit-log-entry-object-audit-log-events) when rules are created (`AUTO_MODERATION_RULE_CREATE`), updated (`AUTO_MODERATION_RULE_UPDATE`), or deleted (`AUTO_MODERATION_RULE_DELETE`), or when AutoMod performs an action (`AUTO_MODERATION_BLOCK_MESSAGE`) + ## Updated Command Permissions #### Apr 27, 2022 diff --git a/docs/resources/Audit_Log.md b/docs/resources/Audit_Log.md index 1f0d537c6a..46e11551ea 100644 --- a/docs/resources/Audit_Log.md +++ b/docs/resources/Audit_Log.md @@ -13,11 +13,12 @@ When an app is performing an eligible action using the APIs, it can pass an `X-A | Field | Type | Description | | ---------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------- | | audit_log_entries | array of [audit log entry](#DOCS_RESOURCES_AUDIT_LOG/audit-log-entry-object) objects | List of audit log entries, sorted from most to least recent | -| guild_scheduled_events | array of [guild scheduled event](#DOCS_RESOURCES_GUILD_SCHEDULED_EVENT/guild-scheduled-event-object) objects | List of guild scheduled events found in the audit log | +| auto_moderation_rules | array of [auto moderation rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) objects | List of auto moderation rules referenced in the audit log | +| guild_scheduled_events | array of [guild scheduled event](#DOCS_RESOURCES_GUILD_SCHEDULED_EVENT/guild-scheduled-event-object) objects | List of guild scheduled events referenced in the audit log | | integrations | array of partial [integration](#DOCS_RESOURCES_GUILD/integration-object) objects | List of partial integration objects | -| threads | array of thread-specific [channel](#DOCS_RESOURCES_CHANNEL/channel-object) objects | List of threads found in the audit log\* | -| users | array of [user](#DOCS_RESOURCES_USER/user-object) objects | List of users found in the audit log | -| webhooks | array of [webhook](#DOCS_RESOURCES_WEBHOOK/webhook-object) objects | List of webhooks found in the audit log | +| threads | array of thread-specific [channel](#DOCS_RESOURCES_CHANNEL/channel-object) objects | List of threads referenced in the audit log\* | +| users | array of [user](#DOCS_RESOURCES_USER/user-object) objects | List of users referenced in the audit log | +| webhooks | array of [webhook](#DOCS_RESOURCES_WEBHOOK/webhook-object) objects | List of webhooks referenced in the audit log | \* Threads referenced in `THREAD_CREATE` and `THREAD_UPDATE` events are included in the threads map since archived threads might not be kept in memory by clients. @@ -120,6 +121,10 @@ If no object is noted, there won't be a `changes` array in the entry, though oth | THREAD_UPDATE | 111 | Thread was updated | [Thread](#DOCS_RESOURCES_CHANNEL/thread-metadata-object) | | THREAD_DELETE | 112 | Thread was deleted | [Thread](#DOCS_RESOURCES_CHANNEL/thread-metadata-object) | | APPLICATION_COMMAND_PERMISSION_UPDATE | 121 | Permissions were updated for a command | [Command Permission](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/application-command-permissions-object-application-command-permissions-structure)\* | +| AUTO_MODERATION_RULE_CREATE | 140 | Auto Moderation rule was created | [Auto Moderation Rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) | +| AUTO_MODERATION_RULE_UPDATE | 141 | Auto Moderation rule was updated | [Auto Moderation Rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) | +| AUTO_MODERATION_RULE_DELETE | 142 | Auto Moderation rule was deleted | [Auto Moderation Rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) | +| AUTO_MODERATION_BLOCK_MESSAGE | 143 | Message was blocked by AutoMod (according to a rule) | | \* Object has exception(s) to available keys. See the [exceptions](#DOCS_RESOURCES_AUDIT_LOG/audit-log-change-object-audit-log-change-exceptions) section below for details. diff --git a/docs/resources/Auto_Moderation.md b/docs/resources/Auto_Moderation.md new file mode 100644 index 0000000000..56617345a3 --- /dev/null +++ b/docs/resources/Auto_Moderation.md @@ -0,0 +1,263 @@ +# Auto Moderation + +Auto Moderation is a feature which allows each [guild](#DOCS_RESOURCES_GUILD/) to set up rules that trigger based on some criteria. For example, a rule can trigger whenever a message contains a specific keyword. + +Rules can be configured to automatically execute actions whenever they trigger. For example, if a user tries to send a message which contains a certain keyword, a rule can trigger and block the message before it is sent. + +### Auto Moderation Rule Object + +###### Auto Moderation Rule Structure + +| Field | Type | Description | +| ---------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| id | snowflake | the id of this rule | +| guild_id | snowflake | the guild which this rule belongs to | +| name | string | the rule name | +| creator_id | snowflake | the user which first created this rule | +| event_type | integer | the rule [event type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-event-types) | +| trigger_type | integer | the rule [trigger type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) | +| trigger_metadata | object | the rule [trigger metadata](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-metadata) | +| actions | array of [action](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object) objects | the actions which will execute when the rule is triggered | +| enabled | boolean | whether the rule is enabled | +| exempt_roles | array of snowflakes | the role ids that should not be affected by the rule (Maximum of 20) | +| exempt_channels | array of snowflakes | the channel ids that should not be affected by the rule (Maximum of 50) | + +###### Example Auto Moderation Rule + +```json +{ + "id": "969707018069872670", + "guild_id": "613425648685547541", + "name": "Keyword Filter 1", + "creator_id": "423457898095789043", + "trigger_type": 1, + "event_type": 1, + "actions": [ + { + "type": 1, + "metadata": {} + }, + { + "type": 2, + "metadata": { "channel_id": "123456789123456789" } + } + ], + "trigger_metadata": { + "keyword_filter": ["cat*", "*dog", "*ana*", "i like javascript"] + }, + "enabled": true, + "exempt_roles": ["323456789123456789", "423456789123456789"], + "exempt_channels": ["523456789123456789"], +} +``` + +###### Trigger Types + +Characterizes the type of content which can trigger the rule. + +| Type | Value | Description | +| -------------------- | ------- | -------------------------------------------------------------------- | +| KEYWORD | 1 | check if content contains words from a user defined list of keywords | +| HARMFUL_LINK | 2 | check if content contains any harmful links | +| SPAM | 3 | check if content represents generic spam | +| KEYWORD_PRESET | 4 | check if content contains words from internal pre-defined wordsets | + +###### Trigger Metadata + +Additional data used to determine whether a rule should be triggered. Different fields are relevant based on the +value of [trigger_type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types). + +| Field | Type | Associated Trigger Types | Description | +| -------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------------------------------------------------------- | +| keyword_filter | array of strings * | KEYWORD | substrings which will be searched for in content | +| presets | array of [keyword preset types](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-keyword-preset-types) | KEYWORD_PRESET | the internally pre-defined wordsets which will be searched for in content | + + +\* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each keyword will be matched. +See [keyword matching strategies](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-keyword-matching-strategies). + + +###### Keyword Preset Types + +| Type | Value | Description | +| ---------------- | ----- | ------------------------------------------------------------ | +| PROFANITY | 1 | Words that may be considered forms of swearing or cursing | +| SEXUAL_CONTENT | 2 | Words that refer to sexually explicit behavior or activity | +| SLURS | 3 | Personal insults or words that may be considered hate speech | + + +###### Event Types + +Indicates in what event context a rule should be checked. + +| Type | Value | Description | +| ---------------- | ------- | --------------------------------------------------- | +| MESSAGE_SEND | 1 | when a member sends or edits a message in the guild | + + +###### Keyword Matching Strategies + +Use the `*` wildcard symbol at the beginning and end of a keyword to define how the keyword should be matched. All keywords are case insensitve. + +**Prefix** - word must start with the keyword + +| Keyword | Matches | +| --------- | --------------------------------------| +| cat\* | **cat**ch, **Cat**apult, **CAt**tLE | +| tra\* | **tra**in, **tra**de, **TRA**ditional | +| the mat\* | **the mat**rix | + + +**Suffix** - word must end with the keyword + +| Keyword | Matches | +| --------- | ----------------------------------- | +| \*cat | wild**cat**, copy**Cat** | +| \*tra | ex**tra**, ul**tra**, orches**TRA** | +| \*the mat | brea**the mat** | + + +**Anywhere** - keyword can appear anywhere in the content + +| Keyword | Matches | +| ----------- | --------------------------- | +| \*cat\* | lo**cat**ion, edu**Cat**ion | +| \*tra\* | abs**tra**cted, ou**tra**ge | +| \*the mat\* | brea**the mat**ter | + + +**Whole Word** - keyword is a full word or phrase and must be surrounded by whitespace at the beginning and end + +| Keyword | Matches | +| ------- | ----------- | +| cat | **cat** | +| train | **train** | +| the mat | **the mat** | + + + +### Auto Moderation Action Object + +An action which will execute whenever a rule is triggered. + +###### Auto Moderation Action Structure + +| Field | Type | Description | +| ----------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- | +| type | [action type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object-action-types) | the type of action | +| metadata? * | [action metadata](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object-action-metadata) | additional metadata needed during execution for this specific action type | + +\* Can be omitted based on `type`. See the `Associated Action Types` column in [action metadata](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object-action-metadata) to understand which `type` values require `metadata` to be set. + +###### Action Types + +| Type | Value | Description | +| --------------------- | ------- | ----------------------------------------------------- | +| BLOCK_MESSAGE | 1 | blocks the content of a message according to the rule | +| SEND_ALERT_MESSAGE | 2 | logs user content to a specified channel | +| TIMEOUT | 3 | timeout user for a specified duration * | + +\* A `TIMEOUT` action can only be setup for `KEYWORD` rules. `MODERATE_MEMBERS` permission is required to use the `TIMEOUT` action type. + + +###### Action Metadata + +Additional data used when an action is executed. Different fields are relevant based on +value of [action type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object-action-types). + +| Field | Type | Associated Action Types | Description | +| ---------------- | ---------- | ----------------------- | ---------------------------------------------- | +| channel_id | snowflake | SEND_ALERT_MESSAGE | channel to which user content should be logged | +| duration_seconds | integer | TIMEOUT | timeout duration in seconds * | + +\* Maximum of 2419200 seconds (4 weeks) + + +### Auto Moderation Permission Requirements + +Users are required to have the `MANAGE_GUILD` permission to access all Auto Moderation resources. +Some [action types](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object-action-types) require additional permissions, e.g. the `TIMEOUT` action type requires an additional `MODERATE_MEMBERS` permission. + +### Auto Moderation Limits Per Trigger Type + +Number of rules allowed per trigger type in each guild. + +| Type | Max Per Guild | +| -------------- | ------------- | +| KEYWORD | 3 | +| HARMFUL_LINK | 1 | +| SPAM | 1 | +| KEYWORD_PRESET | 1 | + +## List Auto Moderation Rules for Guild % GET /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/auto-moderation/rules + +Get a list of all rules currently configured for guild. Returns a list of [auto moderation rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) objects for the given guild. + +> info +> Requires `MANAGE_GUILD` [permissions](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-permission-requirements) + +## Get Auto Moderation Rule % GET /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/auto-moderation/rules/{auto_moderation_rule.id#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object} + +Get a single rule. Returns an [auto moderation rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) object. + +> info +> Requires `MANAGE_GUILD` [permissions](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-permission-requirements) + +## Create Auto Moderation Rule % POST /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/auto-moderation/rules + +Create a new rule. Returns an [auto moderation rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) on success. + +> info +> Requires `MANAGE_GUILD` [permissions](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-permission-requirements) + +###### JSON Params + +| Field | Type | Description | +| ------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| name | string | the rule name | +| event_type | integer | the [event type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-event-types) | +| trigger_type | integer | the [trigger type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) | +| trigger_metadata? * | object | the [trigger metadata](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) | +| actions | array of [action](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object) objects | the actions which will execute when the rule is triggered | +| enabled? | boolean | whether the rule is enabled (False by default) | +| exempt_roles? | array of snowflakes | the role ids that should not be affected by the rule (Maximum of 20) | +| exempt_channels? | array of snowflakes | the channel ids that should not be affected by the rule (Maximum of 50) | + +\* Can be omitted based on `trigger_type`. See the `Associated Trigger Types` column in [trigger metadata](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) to understand which `trigger_type` values require `trigger_metadata` to be set. + +> info +> See [Auto Moderation Limits Per Trigger Type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-limits-per-trigger-type) for limits on how many rules of each trigger type can be created per guild. + + +## Modify Auto Moderation Rule % PATCH /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/auto-moderation/rules/{auto_moderation_rule.id#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object} + +Modify an existing rule. Returns an [auto moderation rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) on success. + +> info +> Requires `MANAGE_GUILD` [permissions](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-permission-requirements). + +> info +> All parameters for this endpoint are optional. + +###### JSON Params + +| Field | Type | Description | +| ---------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| name | string | the rule name | +| event_type | integer | the [event type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-event-types) | +| trigger_metadata? * | object | the [trigger metadata](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) | +| actions | array of [action](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object) objects | the actions which will execute when the rule is triggered | +| enabled | boolean | whether the rule is enabled | +| exempt_roles | array of snowflakes | the role ids that should not be affected by the rule (Maximum of 20) | +| exempt_channels | array of snowflakes | the channel ids that should not be affected by the rule (Maximum of 50) | + +\* Can be omitted based on `trigger_type`. See the `Associated Trigger Types` column in [trigger metadata](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) to understand which `trigger_type` values require `trigger_metadata` to be set. + +## Delete Auto Moderation Rule % DELETE /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/auto-moderation/rules/{auto_moderation_rule.id#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object} + +Delete a rule. Returns a `204` on success. + +> info +> Requires `MANAGE_GUILD` [permissions](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-permission-requirements) + + diff --git a/docs/resources/Channel.md b/docs/resources/Channel.md index d6520bd4da..f5988c477e 100644 --- a/docs/resources/Channel.md +++ b/docs/resources/Channel.md @@ -304,6 +304,7 @@ Represents a message sent in a channel within Discord. | THREAD_STARTER_MESSAGE | 21 | | GUILD_INVITE_REMINDER | 22 | | CONTEXT_MENU_COMMAND | 23 | +| AUTO_MODERATION_ACTION | 24 | ###### Message Activity Structure diff --git a/docs/resources/Guild.md b/docs/resources/Guild.md index dc0d6f49fd..3e1ca4dd82 100644 --- a/docs/resources/Guild.md +++ b/docs/resources/Guild.md @@ -122,6 +122,7 @@ Guilds in Discord represent an isolated collection of users and channels, and ar | -------------------------------- | ------------------------------------------------------------------------------------------------------------------- | | ANIMATED_BANNER | guild has access to set an animated guild banner image | | ANIMATED_ICON | guild has access to set an animated guild icon | +| AUTO_MODERATION | guild has set up auto moderation rules | | BANNER | guild has access to set a guild banner image | | COMMERCE | guild has access to use commerce features (i.e. create store channels) | | COMMUNITY | guild can enable welcome screen, Membership Screening, stage channels and discovery, and receives community updates | diff --git a/docs/topics/Gateway.md b/docs/topics/Gateway.md index 5c71f86477..42e95a663b 100644 --- a/docs/topics/Gateway.md +++ b/docs/topics/Gateway.md @@ -301,6 +301,15 @@ GUILD_SCHEDULED_EVENTS (1 << 16) - GUILD_SCHEDULED_EVENT_DELETE - GUILD_SCHEDULED_EVENT_USER_ADD - GUILD_SCHEDULED_EVENT_USER_REMOVE + +AUTO_MODERATION_CONFIGURATION (1 << 20) + - AUTO_MODERATION_RULE_CREATE + - AUTO_MODERATION_RULE_UPDATE + - AUTO_MODERATION_RULE_DELETE + +AUTO_MODERATION_EXECUTION (1 << 21) + - AUTO_MODERATION_ACTION_EXECUTION + ``` \* [Thread Members Update](#DOCS_TOPICS_GATEWAY/thread-members-update) contains different data depending on which intents are used. @@ -481,6 +490,10 @@ Events are payloads sent over the socket to a client that correspond to events i | [Reconnect](#DOCS_TOPICS_GATEWAY/reconnect) | server is going away, client should reconnect to gateway and resume | | [Invalid Session](#DOCS_TOPICS_GATEWAY/invalid-session) | failure response to [Identify](#DOCS_TOPICS_GATEWAY/identify) or [Resume](#DOCS_TOPICS_GATEWAY/resume) or invalid active session | | [Application Command Permissions Update](#DOCS_TOPICS_GATEWAY/application-command-permissions-update) | application command permission was updated | +| [Auto Moderation Rule Create](#DOCS_TOPICS_GATEWAY/auto-moderation-rule-create) | auto moderation rule was created | +| [Auto Moderation Rule Update](#DOCS_TOPICS_GATEWAY/auto-moderation-rule-update) | auto moderation rule was updated | +| [Auto Moderation Rule Delete](#DOCS_TOPICS_GATEWAY/auto-moderation-rule-delete) | auto moderation rule was deleted | +| [Auto Moderation Action Execution](#DOCS_TOPICS_GATEWAY/auto-moderation-action-execution) | auto moderation rule was triggered and an action was executed (e.g. a message was blocked) | | [Channel Create](#DOCS_TOPICS_GATEWAY/channel-create) | new guild channel created | | [Channel Update](#DOCS_TOPICS_GATEWAY/channel-update) | channel was updated | | [Channel Delete](#DOCS_TOPICS_GATEWAY/channel-delete) | channel was deleted | @@ -820,6 +833,46 @@ The inner `d` key is a boolean that indicates whether the session may be resumab `APPLICATION_COMMAND_PERMISSIONS_UPDATE` event, sent when an application command's permissions are updated. The inner payload is an [application command permissions](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/application-command-permissions-object-guild-application-command-permissions-structure) object. +### Auto Moderation + +All auto moderation related events are currently only sent to bot users which have the `MANAGE_GUILD` permission. + +#### Auto Moderation Rule Create + +Sent when a rule is created. The inner payload is an [auto moderation rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) object. + +#### Auto Moderation Rule Update + +Sent when a rule is updated. The inner payload is an [auto moderation rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) object. + +#### Auto Moderation Rule Delete + +Sent when a rule is deleted. The inner payload is an [auto moderation rule](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object) object. + +#### Auto Moderation Action Execution + +Sent when an rule is triggered and an action is executed (e.g. message is blocked). + +###### Auto Moderation Action Execution Event Fields + +| Field | Type | Description | +| ------------------------ | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| guild_id | snowflake | the id of the guild in which action was executed | +| action | [auto moderation action](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-action-object) object | the action which was executed | +| rule_id | snowflake | the id of the rule which action belongs to | +| rule_trigger_type | [trigger_type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) | the trigger type of rule which was triggered | +| user_id | snowflake | the id of the user which generated the content which triggered the rule | +| channel_id? | snowflake | the id of the channel in which user content was posted | +| message_id? | snowflake | the id of any user message which content belongs to * | +| alert_system_message_id? | snowflake | the id of any system auto moderation messages posted as a result of this action ** | +| content | string | the user generated text content | +| matched_keyword | ?string | the word or phrase configured in the rule that triggered the rule | +| matched_content | ?string | the substring in content that triggered the rule | + + +\* `message_id` will not exist if message was blocked by automod or content was not part of any message +\** `alert_system_message_id` will not exist if this event does not correspond to an action with type `SEND_ALERT_MESSAGE` + ### Channels #### Channel Create