LIGHTNING / Documentation

AutoMod Configuration

AutoMod helps you reduce spam and keep your server readable by automatically taking moderation actions when limits are hit.

You can use both slash commands (recommended) and prefix commands:

  • Slash: /automod ...
  • Prefix: .automod ...

The examples below follow the command prefix selected above.

Quick start (2 minutes)

  1. Open the interactive setup:
@Lightning automod rules interactive
  1. Create one or two core rules:
  • Message spam: 5/10s with warn or delete
  • Invite spam: 1/30s with delete or warn
  1. Add channels/roles you want ignored:
@Lightning automod ignore #staff @moderators
  1. Check your final setup:
@Lightning automod view

How AutoMod rules work

Each advanced rule uses:

  • A limit (count)
  • A time window (seconds)
  • A punishment (delete, warn, mute, kick, or ban)

Example:

@Lightning automod rules add message-spam 5/10s warn

This means: on the 5th message in 10 seconds, AutoMod triggers.

You can write intervals in two formats:

  • 5/10s
  • 5 10

If you use mute or ban, you can add a duration:

@Lightning automod rules add message-spam 5/10s mute 30m

Advanced rules

Rule What it checks
message-spam How many total messages a member sends in the time window.
mass-mentions How many user/role mentions are in a message burst.
url-spam Messages containing http:// or https:// links.
invite-spam Messages containing Discord invite links (discord.gg / discord.com/invite).
message-content-spam Repeated messages (tracked by member + message length).

Common commands:

@Lightning automod rules add <rule> <count>/<seconds>s <delete|warn|mute|kick|ban> [duration]
@Lightning automod rules remove <rule>

Basic rules (name cleanup)

Basic rules do not use a rate limit. They are simple on/off protections.

Rule What it does
auto-dehoist Renames display names that start with common hoist characters (like !, #, $).
auto-normalize Normalizes display names to a cleaner ASCII-like form.

Commands:

@Lightning automod rules addbasic <auto-dehoist|auto-normalize>
@Lightning automod rules remove <auto-dehoist|auto-normalize>

Ignores (exemptions you control)

You can exclude roles, members, channels, and threads from AutoMod.

Commands:

@Lightning automod ignore <entities...>
@Lightning automod unignore <entities...>
@Lightning automod ignored

Examples:

@Lightning automod ignore @moderators #staff-chat
@Lightning automod unignore #staff-chat

AutoMod also skips some messages automatically, including DMs, bot messages, and members who are trusted by your server's Lightning permission config.


Warn threshold (separate from spam rules)

Warn threshold is a server-wide escalation rule:

  • If a member reaches X warnings, Lightning automatically kicks or bans them.
  • This is based on warning infractions, not just AutoMod warnings.

Commands:

@Lightning automod warnthreshold set <1-10> <kick|ban>
@Lightning automod warnthreshold remove
@Lightning automod warnthreshold migrate

Gatekeeper (join verification)

Gatekeeper restricts new members until they verify.

Start setup:

@Lightning automod gatekeeper

The setup UI lets you:

  • Choose/create a verification role
  • Choose a verification channel
  • Pick a verification type
  • Send (or update) the verification message
  • Enable/disable Gatekeeper

Verification types:

  • Basic: Member clicks Verify Me.
  • Honeypot: Member must click the one safe button; wrong choice attempts a kick.

Troubleshooting

  • "This rule has already been set up": remove it first, then add it again.
  • AutoMod not triggering: check @Lightning automod view, then confirm the user/channel/role is not ignored.
  • Muted users are not being muted: ensure your mute role/config is valid if timeout cannot be used.
  • Not sure what is active? use @Lightning automod view.

If you are new, start with:

  • message-spam -> 5/10s -> warn
  • invite-spam -> 1/30s -> delete
  • mass-mentions -> 6/10s -> warn

Then adjust once you see real traffic patterns in your server.