Auto-Moderation Guide
Configure automated rules for spam, links, invites, blocked words, mentions, caps, and duplicate messages.
Overview
Lyx's auto-moderation system provides granular, rule-based automation. Each rule type can be configured independently with custom thresholds, actions, and exemptions. Rules are evaluated in real-time on every message.
Enabling Auto-Moderation
/automod enable
Disable with /automod disable. View current config with /automod status.
In the dashboard, use the master toggle at the top of the Auto-Moderation page.
Spam Detection
Detects rapid repeated messages from the same user.
/automod spam max_messages:5 time_window:10 action:delete,warn
- max_messages: Messages allowed in window (default: 5)
- time_window: Time window in seconds (default: 10)
- action: Comma-separated actions (delete, warn, timeout, alert)
Triggers when a user sends more than max_messages within time_window seconds.
Link Filtering
Controls which links can be posted.
/automod links block_all:false allowed_domains:"youtube.com,twitter.com,github.com" action:delete
- block_all: true = only allowlisted domains permitted; false = block only non-allowlisted
- allowed_domains: Comma-separated domains (no protocol needed)
- action: Actions on violation
With block_all:false (default), all links allowed except those matching blocked patterns. With block_all:true, ONLY listed domains allowed.
Invite Blocking
Blocks Discord invite links (discord.gg, discord.com/invite).
/automod invites block_discord_invites:true allowed_invites:"ABC123,my-community" action:timeout,alert
- block_discord_invites: Block all Discord invites (default: true)
- allowed_invites: Comma-separated invite codes to allow
- action: Actions on violation
Word Filters
Custom blocked word list with optional regex support.
/automod words action:add words:"badword1,badword2,(?i)regex_pattern" regex:true
- action: add, remove, or list
- words: Comma-separated words/patterns
- regex: Treat as regex patterns (default: false)
Regex examples: (?i)badword (case-insensitive), \bspam\b (word boundary).
Mention Limits
Prevents mass mentions in a single message.
/automod mentions max_user_mentions:5 max_role_mentions:2 action:delete,warn
- max_user_mentions: Max @user mentions (default: 5)
- max_role_mentions: Max @role mentions (default: 2)
- action: Actions on violation
Caps Detection
Detects excessive capitalization in messages.
/automod caps min_length:10 max_percentage:70 action:delete
- min_length: Minimum message length to check (default: 10)
- max_percentage: Max % caps allowed (default: 70%)
- action: Actions on violation
Only checks messages longer than min_length. Calculates uppercase letter percentage.
Duplicate Detection
Detects repeated similar messages (copypasta, spam).
/automod duplicates time_window:60 similarity:90 action:delete
- time_window: Seconds to look back (default: 60)
- similarity: Similarity threshold % (default: 90)
- action: Actions on violation
Compares new messages to recent messages using similarity algorithm.
Action Types
Each rule can take multiple actions. Available actions:
| Action | Description |
|---|---|
delete | Delete the triggering message |
warn | Issue a warning to the user (creates case) |
timeout | Timeout user (requires duration config) |
alert | Send alert to staff log channel |
Timeout duration is configured per-rule in the dashboard, or uses server default.
Exemptions
Exempt specific roles or channels from all auto-mod rules.
/automod exemptions type:role action:add target:@Moderator
/automod exemptions type:channel action:add target:#bot-commands
- type: role or channel
- action: add, remove, list
- target: Role mention or channel mention
Exempted users/channels bypass ALL auto-mod rules. Use for moderators, bots, or testing channels.
Log Channel
Set a dedicated channel for auto-mod action logs.
/automod logs channel:#automod-logs
Logs include: rule triggered, action taken, user, channel, matched content (truncated).
Testing Rules
Before enabling rules in production:
- Configure rule with
action:alertonly - Test in a controlled channel
- Monitor alerts in log channel
- Adjust thresholds as needed
- Add final actions (delete, warn, timeout)
- Enable auto-mod globally
The dashboard provides test controls for each rule with sample messages.
Dashboard Builder
The Auto-Moderation page (/dashboard/{guildId}/automod) provides a visual builder:
- Rule cards with enable/disable toggles
- Threshold sliders and inputs
- Action checkboxes per rule
- Exempt role/channel multi-selectors
- Test message input with live evaluation
- Recent automod events table
All changes save instantly via API with loading/error states.
Common Issues
False positives on spam detection
Increase max_messages or time_window. Exempt active channels like #bot-commands. Consider higher thresholds for large servers.
Links not being blocked
Check: 1) Rule is enabled, 2) Auto-mod is globally enabled, 3) Channel/role not exempted, 4) Domain matching is correct (subdomains included).
Word filter not catching variations
Use regex for variations: (?i)badword for case-insensitive, badwo?rd for optional letters. Test with /automod words action:list.
Actions not executing
Ensure Lyx has required permissions: Manage Messages (delete), Moderate Members (timeout/warn), View Channel/Read History. Check role hierarchy.