# 🔎 Chat Filter

> **Info:**
This module is configured in **modules/chat.yml** inside the PhoenixLobby folder.

## Chat Filter

The chat filter blocks the messages that match one of your patterns. The two default patterns block links and ip addresses. Open it from **Editor > Settings > Chat > Chat Filter**.

Players with `phoenixlobby.bypass.chatfilter` are not checked.

<figure><img src="../../.gitbook/assets/chat/chat-filter.png" alt="" width="563"><figcaption><p>Chat (Chat Filter)</p></figcaption></figure>

## Patterns

The list of patterns a message is checked against.

<figure><img src="../../.gitbook/assets/chat-filter/patterns.png" alt="" width="563"><figcaption><p>Chat Filter (Patterns)</p></figcaption></figure>

## Censor Matches

Turn this on to replace the matched part with the censor character instead of blocking the whole message. **Censor Character** is what the match is replaced with.

<figure><img src="../../.gitbook/assets/chat-filter/censor-matches.png" alt="" width="563"><figcaption><p>Chat Filter (Censor Matches)</p></figcaption></figure>

<figure><img src="../../.gitbook/assets/chat-filter/censor-character.png" alt="" width="563"><figcaption><p>Chat Filter (Censor Character)</p></figcaption></figure>

## Case Insensitive

With this on, a pattern matches no matter how the message is capitalised.

<figure><img src="../../.gitbook/assets/chat-filter/case-insensitive.png" alt="" width="563"><figcaption><p>Chat Filter (Case Insensitive)</p></figcaption></figure>

## Feature State

Turns the chat filter off without clearing the patterns.

<figure><img src="../../.gitbook/assets/chat-filter/feature-state.png" alt="" width="563"><figcaption><p>Chat Filter (Feature State)</p></figcaption></figure>

<details>

<summary>Chat Filter Config</summary>

```yaml
filter:
  enabled: true
  case-insensitive: true
  censor-matches: false
  censor-character: '*'
  patterns:
  - (?:https?://)?(?:[\w-]+\.)+(?:com|net|org|gg|io|me|tv|xyz)(?:/\S*)?
  - \b(?:\d{1,3}\.){3}\d{1,3}(?::\d{1,5})?\b
```

</details>

> **Info:**
The patterns are regular expressions, so a plain word works as well as a full pattern.

Source: https://www.phoenixplugins.com/docs/phoenix-lobby/modules/chat-resync/chat-filter