> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flarebot.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# AutoMod

> Automatically filter spam, malicious links, and bad words.

## Overview

Flare's AutoMod is a silent guardian that works 24/7 to keep your chat clean. By analyzing messages in real-time, it can instantly delete prohibited content and automatically punish users who repeatedly break the rules.

### Why use AutoMod?

Human moderators can't be online every second of the day. AutoMod instantly neutralizes threats like invite-spam, phishing links, and chat floods before anyone even sees them.

***

## Requirements

<Warning>
  Flare must have the `Manage Messages` permission to delete offending messages, and `Moderate Members` (Timeout) or `Kick`/`Ban` to issue automated punishments.
</Warning>

***

## Core Filters

Flare provides several distinct filters that you can toggle individually.

<Tabs>
  <Tab title="Anti-Spam">
    Detects when a user sends messages too rapidly (e.g., 5 messages in 3 seconds).

    ```bash theme={null}
    /automod antispam enable
    ```
  </Tab>

  <Tab title="Anti-Link">
    Deletes any message containing a URL (`http://` or `https://`). Excellent for preventing phishing attacks.

    ```bash theme={null}
    /automod antilink enable
    ```
  </Tab>

  <Tab title="Anti-Invite">
    Specifically targets Discord server invites (`discord.gg/`).

    ```bash theme={null}
    /automod antiinvite enable
    ```
  </Tab>

  <Tab title="Bad Words">
    Deletes messages containing specific profanity or blacklisted words.

    ```bash theme={null}
    /automod badwords enable
    /automod badwords add <word>
    ```
  </Tab>
</Tabs>

***

## Automated Punishments

By default, AutoMod will only **delete** the offending message. However, you can configure a Strike system to punish repeat offenders.

When a user triggers AutoMod, they gain a strike. You can configure what happens when they reach the threshold.

```bash theme={null}
# Punish a user with a 1 hour timeout if they trigger AutoMod
/automod punishment set timeout 1h
```

***

## Whitelisting (Bypassing AutoMod)

You likely don't want your moderators getting timed out for posting links. You can whitelist roles or entire channels to bypass the filters.

<CodeGroup>
  ```bash Whitelist a Role theme={null}
  /automod whitelist role @Moderator
  ```

  ```bash Whitelist a Channel theme={null}
  # Great for #self-promo or #memes channels
  /automod whitelist channel #media
  ```
</CodeGroup>

<Info>Users with the `Administrator` permission inherently bypass all AutoMod filters.</Info>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="AutoMod is deleting links in the self-promo channel!">
    You need to explicitly whitelist that channel. Run `/automod whitelist channel #self-promo`.
  </Accordion>

  <Accordion title="AutoMod isn't deleting messages from regular users">
    Ensure Flare has the `Manage Messages` permission in that specific channel. If the user has a whitelisted role, or has the `Administrator` permission, AutoMod will ignore them.
  </Accordion>
</AccordionGroup>

## Related Pages

* [Moderation Commands](/commands/moderation)
* [Logging Overview](/logging/overview)
