automodRule := create_automod_rule(Args{
server_id: trigger.server_id,
name: "...",
trigger_type: "Keyword",
action_type: "Block Message",
})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Rule ID: " + automodRule.rule_id,
})
Create AutoMod Rule
Create an auto moderation rule.
Inputs
Server to create the rule in.
Name of the rule.
Event context for the rule.
Type of content that triggers the rule.
Comma-separated keywords to match against.
Comma-separated regex patterns to match against.
Pre-defined wordsets to use.
Comma-separated words that should not trigger the rule.
Max unique role and user mentions allowed per message.
Whether the rule is enabled.
Comma-separated role IDs exempt from the rule.
Comma-separated channel IDs exempt from the rule.
Action to take when the rule is triggered.
Channel for alert messages (used with Send Alert Message).
Timeout duration in seconds (used with Timeout).
Custom message shown when a message is blocked (used with Block Message).
Outputs
ID of the created rule.
ID of the server.
Name of the rule.
User who created the rule.
Whether the rule is enabled.
Event type.
Trigger type.
Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.
Advanced Documentation
This documentation can be useful when using code mode. View as Markdown
create_automod_ruleInputs
| Field | InventScript name | Value |
|---|---|---|
| Server ID | server_id | |
| Name | name | |
| Event Type | event_type | "Message Send", "Member Update" |
| Trigger Type | trigger_type | "Keyword", "Spam", "Keyword Preset", "Mention Spam", "Member Profile" |
| Keyword Filter | keyword_filter | |
| Regex Patterns | regex_patterns | |
| Presets | presets | "Profanity", "Sexual Content", "Slurs" |
| Allow List | allow_list | |
| Mention Total Limit | mention_total_limit | |
| Enabled | enabled | "true", "false" |
| Exempt Roles | exempt_roles | |
| Exempt Channels | exempt_channels | |
| Action Type | action_type | "Block Message", "Send Alert Message", "Timeout" |
| Action Channel ID | action_channel_id | |
| Action Duration (Seconds) | action_duration_seconds | |
| Action Custom Message | action_custom_message |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Rule ID | rule_id | |
| Server ID | server_id | |
| Name | name | |
| Creator ID | creator_id | |
| Enabled | enabled | |
| Event Type | event_type | |
| Trigger Type | trigger_type |