# Anti Chat Flood

## About this module

The Intelligent Anti Chat Flood module prevents or intelligently modifies the use of excessive repeated characters and very long "words" without interfering with players using 'expressive' chat.

{% hint style="info" %}
To bypass this module, op or the permission: "**chatsentry.antichatflood.bypass**" is required.
{% endhint %}

## Config guide

You can access the below settings in the **anti-chat-flood.yml** file within the **modules** folder of the plugin's root folder.

{% hint style="success" %}
**Config excerpts taken from v3.6.0 and may not be completely up-to-date with the latest changes. To see the most up-to-date file, see below:**
{% endhint %}

{% content-ref url="/pages/-MOrlYuxxIGjl0QFBUAB" %}
[anti-chat-flood.yml](/files/files/module-configurations/anti-chat-flood.yml.md)
{% endcontent-ref %}

### repeated-character-limit

The maximum times the same character can be repeated consecutively. Applies to all characters not on the custom limit list below this option.

If using `modify-message`, this is not the exact amount of characters that will show up in chat (there will probably be a few less, depending on the circumstance).

```yaml
repeated-character-limit: 12
```

### custom-limits

Since some characters take up less space (like "!") you can optionally allow them to be repeated additional times to reduce interferences with people being extra expressive in chat who aren't attempting to flood it

**Format: `<CHARACTER>;;<REPEAT LIMIT>`**

*Set to "custom-limits: \[]" to have no custom limits*

Please note that this list is case sensitive

```yaml
custom-limits:
  - "!;;30"
  - "?;;12"
  - ".;;35"
  - "A;;12"
```

### max-word-length

Maximum character length of words (ignores custom limit chars)

```yaml
max-word-length: 32
```

### &#xD;ignore-long-links

Should web links longer than the maximum "word" length limit be ignored?

```yaml
ignore-long-links: true
```

### modify-message

When set to true, the detected message will be intelligently modified instead of blocked entirely.\
The amount of repeated chars to cut off is determined by a division of the initial limit

**Example: "Heyyyyyyyyyyyyyyy" -> becomes -> "Heyyyyy"**

```yaml
modify-message: true
```

### send-block-message-when-modified

Only applies if `modify-message` is true. When a message is modified, should the blocked message below be sent as well?

```yaml
send-block-message-when-modified: true
```

### affected-commands&#xD;

{% hint style="warning" %}
The below list will only work if "process-commands" is true in config.yml
{% endhint %}

The below list is which commands the module will apply to. It's recommended to only set these to your private messaging commands.

*Set the list to "affected-commands: \[]" to apply the module to ALL commands (highly not recommended!)*&#x20;

Make sure to only include base commands; don't add any command arguments. (spaces)

```yaml
affected-commands:
  - "/tell"
  - "/t"
  - "/msg"
  - "/w"
  - "/r"
  - "/whisper"
  - "/w"
  - "/pm"
```


---

# 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://wiki.chatsentry.xyz/config-guides/module-config-guides/anti-chat-flood.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.
