# Message check

> Branch on what a message holds, for auto-moderation.

Source: https://docs.buildcord.dev/nodes/conditions/message-check/

`logic.message` looks at a message's text for what moderation bots look for: banned words, links, invites, files, mentions, shouting and spam.

## Settings

| Setting | What it does |
| --- | --- |
| Check whether it | See the table below. |
| Words, pattern or amount | What the check needs, if anything. |
| Text | The text to check. Empty is the message that started the flow, `{message.content}`. |

| Check | Passes when the message |
| --- | --- |
| Contains any of these words | Has one of a list of words, separated by commas, such as `{var.bannedWords}`. Words match whole and ignore capitals and punctuation, so `cat` doesn't match `catalog`. |
| Has a link | Has a web address. GIFs from Tenor and Giphy don't count. |
| Has a server invite | Has a discord.gg or discord.com/invite link. |
| Has a file | Has an attachment. |
| Mentions someone | Mentions a member. |
| Is mostly capitals | Is at least 8 letters and mostly capitals: 70% unless you give another share. |
| Has at least this many emoji | Has that many emoji or more: 5 unless you say. |
| Is at least this many characters, lines | Is that long. |
| Matches a pattern | Matches a regular expression. |

## Ways out

| Way out | Taken when |
| --- | --- |
| `It does` | The check passes. |
| `It doesn't` | It doesn't. |

## Notes

- Reading a message's text needs the Message Content intent, which the builder adds when a flow reads `{message.content}`.

## Example

On **Message sent**: a Message check for invites, then [Delete a message](https://docs.buildcord.dev/nodes/messages/delete-message) and [Timeout a member](https://docs.buildcord.dev/nodes/members/timeout) for 10 minutes.

## Related

- [Comparison](https://docs.buildcord.dev/nodes/conditions/comparison)
- [Purge messages](https://docs.buildcord.dev/nodes/server/purge-messages)
