# Filter Invites

{% hint style="info" %}
Replace \[prefix] with your server's prefix.
{% endhint %}

## Filter Invites Enable <a href="#filter-invites-enable" id="filter-invites-enable"></a>

Enabling the invite filter will delete messages that contain Discord server invites. To enable the filter, run the following command:

```
[prefix]filter invites enable
```

Once you run that command, serenity will prompt you with an embed confirming it enabled the invite filter. Invites can no longer be sent.

{% hint style="info" %}
People with the *Manage Server* permission can bypass this filter.
{% endhint %}

<figure><img src="https://2138524749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKC3Q8gA6avaSjTCmPTwv%2Fuploads%2FzWoBvgZhIoX9FKn4Y3GE%2Fimage.png?alt=media&#x26;token=8bf090e0-5ae6-46dc-ba1c-dfbc0d5519a1" alt=""><figcaption></figcaption></figure>

#### **Already Enabled**

If you get a message saying "The filter for Discord invites is already enabled", it means what it says. The filter for Discord invites is already enabled in your server.

## Whitelist & Unwhitelist <a href="#whitelist-and-unwhitelist" id="whitelist-and-unwhitelist"></a>

### Whitelist Channels <a href="#whitelist-channels" id="whitelist-channels"></a>

You can allow invites to be sent in certain channels. To do this, run the following command:

```
[prefix]filter invites whitelist [channel]
```

Once you run that command, users will be able to send invites in the channel specified. serenity will send a confirmation message telling you that it has whitelisted that channel.

<figure><img src="https://2138524749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKC3Q8gA6avaSjTCmPTwv%2Fuploads%2FnJQT05dJYMAmsEaN2VT7%2Fimage.png?alt=media&#x26;token=10b83337-f979-46fb-8c2a-b3ffb582079d" alt=""><figcaption></figcaption></figure>

**Already Whitelisted**

If you get a message saying "This channel is already exempt", it means what it says. The filter for Discord invites does not apply for that channel. Read [Unwhitelist Channels](#unwhitelist-channels) to learn how to disable this.

## Unwhitelist Channels

You can unwhitelist a whitelisted channel to disallow members from sending invites in that channel. To do this, run the following command:

```
[prefix]filter invites unwhitelist [channel]
```

Once you run that command, users will no longer able to send invites in the channel specified. serenity will send a confirmation message telling you that it has unwhitelisted that channel.

<figure><img src="https://2138524749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKC3Q8gA6avaSjTCmPTwv%2Fuploads%2FwlNrsl5aChKTF1XKt8xy%2Fimage.png?alt=media&#x26;token=c8995a33-e8ea-4ad5-8a26-2952a45221e7" alt=""><figcaption></figcaption></figure>

**Not Whitelisted**

If you get a message saying "This channel is not whitelisted", it means what it says. The filter for Discord invites is already enabled in that channel. Read [Whitelist Channels](#whitelist-channels) to learn how to enable this.

## Whitelisted Channels

You can get a list of all whitelisted channels by using the following command:

```
[prefix]filter invites whitelisted
```

**No exempted channels**

If you get a message saying "No exempted channels for invites filter", it means what it says. The filter for Discord invites applies for all channels. Read [Whitelist Channels](#whitelist-channels) to learn how to whitelist channels from the filter.

## Disable the Invites Filter

You can disable the invite filter by using the following command:

```
[prefix]filter invites disable
```

Running this command will remove the invite filter from every channel.

{% hint style="danger" %}
All members will be able to send invites in your server.
{% endhint %}

Once you have ran this command, serenity will send an embed confirming that the invite filter has been disabled.

<figure><img src="https://2138524749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKC3Q8gA6avaSjTCmPTwv%2Fuploads%2FZBIhpucUbu9U5QQrrZTP%2Fimage.png?alt=media&#x26;token=bac340e3-fa02-4f44-af01-40a41b2d15b5" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.serenity.wtf/security-setup/automod/filter-invites.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
