# Anti Spam

## Filter

### Replace Symbols

Before the filters are ran, certain symbols often used to bypass filters will be replaced.\
For example:\
`This server is sh1t` → `This server is shit`

```yaml
anti-spam:
    filter:
        # before the filter is ran, these letters/symbols will be replaced to ensure it can't be bypassed
        replace-symbols:
            1: "i"
            $: "s"
            "@": "a"
            "!": "i"
            l: "i"
            0: "o"
            -: ""
            =: ""
            _: ""
            "`": ""
            "*": ""
            k: "c"
            
            # You can add this if you want spaces to be ignored
            # " ": ""
```

### Format

```yaml
anti-spam:
    filter:
        rules:
            <rule-name>:
                enabled: true
                
                # channels the rule is active in
                channels:
                    - global

                # if the filtered words list should match using regex
                # note: symbols from the "replace-symbols" list will not be replaced while using regex
                use-regex: false
                # list of banned words and phrases
                filtered-words:
                    - these
                    - words
                    - are
                    - banned

                actions:
                    # leave blank to disable
                    # replaces filtered words with this character or phrase.
                    # would replace "fuck" with "****"
                    replace: "*"

                    # if the player's message should still be stopped from being sent or not
                    block-message: false
                    
                    # message player will be sent for breaking rule
                    # leave blank to disable
                    message: ""

                    # commands that are executed when rule is broken
                    commands:
                        - "warn %player% Chat filter"
```

## Repeat Messages

```yaml
anti-spam:
    # can be bypassed with the "astrachat.channels.<channel>.manage" or "astrachat.admin" permissions
    prevent-repeat-messages: true
```
