# Modify AutoMod Rule

> Modify an existing auto moderation rule.

- ID: `modify_automod_rule`
- Type: Block
- Category: [Auto Moderation](https://inventor.bot/docs/reference/blocks/auto-moderation.md)

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `server_id` | yes | Server the rule belongs to. |  |
| `rule_id` | yes | ID of the rule to modify. |  |
| `name` |  | New name for the rule. |  |
| `event_type` |  | New event context for the rule. | `"Message Send"`, `"Member Update"` |
| `trigger_type` |  | New trigger type. | `"Keyword"`, `"Spam"`, `"Keyword Preset"`, `"Mention Spam"`, `"Member Profile"` |
| `keyword_filter` |  | Comma-separated keywords to match against. |  |
| `regex_patterns` |  | Comma-separated regex patterns to match against. |  |
| `presets` |  | Pre-defined wordsets to use. | `"Profanity"`, `"Sexual Content"`, `"Slurs"` |
| `allow_list` |  | Comma-separated words that should not trigger the rule. |  |
| `mention_total_limit` |  | Max unique role and user mentions allowed per message. |  |
| `enabled` |  | Whether the rule is enabled. | `"true"`, `"false"` |
| `exempt_roles` |  | Comma-separated role IDs exempt from the rule. |  |
| `exempt_channels` |  | Comma-separated channel IDs exempt from the rule. |  |
| `action_type` |  | Action to take when the rule is triggered. | `"Block Message"`, `"Send Alert Message"`, `"Timeout"` |
| `action_channel_id` |  | Channel for alert messages (used with Send Alert Message). |  |
| `action_duration_seconds` |  | Timeout duration in seconds (used with Timeout). |  |
| `action_custom_message` |  | Custom message shown when a message is blocked (used with Block Message). |  |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `rule_id` | ID of the modified rule. |  |
| `server_id` | ID of the server. |  |
| `name` | Name of the rule. |  |
| `creator_id` | User who created the rule. |  |
| `enabled` | Whether the rule is enabled. |  |
| `event_type` | Event type. |  |
| `trigger_type` | Trigger type. |  |

**Example**

```go
automodRule := modify_automod_rule(Args{server_id: trigger.server_id, rule_id: "..."})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Rule ID: " + automodRule.rule_id,
})
```