# Filters

## How it works?

You can find an explanation [**here**](/overview/how-it-works.md#filters).

{% hint style="danger" %}
Be sure to have read [how to configure a character](/fundamentals/getting-set-up/configure-a-character.md) and [how to configure a behavior](/fundamentals/getting-set-up/configure-a-behavior.md) before starting here.
{% endhint %}

## List

This section lists all the types of filters that can be added to behaviors.

{% hint style="info" %}
Every filters support the [placeholders](/behavior/placeholders.md) which can be used anywhere there is text.
{% endhint %}

{% hint style="info" %}
Each filter contains a "reversed" option. Validate the filter only if the result is invalid.\
Usually, you will choose to set this option to "Disabled".
{% endhint %}

### HAS\_ROLE

Allows you to ignore members who do not have a specific role.

#### Settings

<table><thead><tr><th width="174">Name of setting</th><th width="314.3333333333333">Description</th><th>Type of input</th></tr></thead><tbody><tr><td>Roles</td><td>List of roles to filter.</td><td>Selecting from a defined list</td></tr></tbody></table>

***

### CHANNEL

Allows you to ignore channels other than the one selected.

💡It is very common to add this filter so that a behavior is triggered only when the event is called in a specific channel.

#### Settings

<table><thead><tr><th width="174">Name of setting</th><th width="314.3333333333333">Description</th><th>Type of input</th></tr></thead><tbody><tr><td>Channel</td><td>The only authorized channel.</td><td>Selecting from a defined list</td></tr></tbody></table>

***

### MESSAGE\_CONTAINS

Allows you to ignore messages that do not contain specific text.

💡It is very common to add this filter so that a behavior is triggered only when something is mentioned in a message. For example the name of the character.

#### Settings

<table><thead><tr><th width="174">Name of setting</th><th width="372.3333333333333">Description</th><th>Type of input</th></tr></thead><tbody><tr><td>Content</td><td>The content that the message must contain.</td><td>Text</td></tr><tr><td>Case-sensitive</td><td>Should case sensitivity be checked.</td><td>Enabled/Disabled</td></tr></tbody></table>

***

### MESSAGE\_EQUALS

Allows you to ignore messages that are not exactly the one configured.

#### Settings

<table><thead><tr><th width="174">Name of setting</th><th width="372.3333333333333">Description</th><th>Type of input</th></tr></thead><tbody><tr><td>Content</td><td>The content that must fully correspond to the message.</td><td>Text</td></tr><tr><td>Case-sensitive</td><td>Should case sensitivity be checked.</td><td>Enabled/Disabled</td></tr></tbody></table>

***

### MESSAGE\_STARTS\_WITH

Allows you to ignore messages that do not start with a particular text.

#### Settings

<table><thead><tr><th width="174">Name of setting</th><th width="405.3333333333333">Description</th><th>Type of input</th></tr></thead><tbody><tr><td>Content</td><td>The content with which the message must start.</td><td>Text</td></tr><tr><td>Case-sensitive</td><td>Should case sensitivity be checked.</td><td>Enabled/Disabled</td></tr></tbody></table>

***

### MESSAGE\_ENDS\_WITH

Allows you to ignore messages that do not end with a particular text.

#### Settings

<table><thead><tr><th width="174">Name of setting</th><th width="391.3333333333333">Description</th><th>Type of input</th></tr></thead><tbody><tr><td>Content</td><td>The content with which the message must end</td><td>Text</td></tr><tr><td>Case-sensitive</td><td>Should case sensitivity be checked.</td><td>Enabled/Disabled</td></tr></tbody></table>


---

# 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.characterweaver.com/behavior/filters.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.
