> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dogebot.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> Make your Yapin bot react to what happens in a server.

Events run blocks when something happens, without anyone typing a command.

## Triggers

| Trigger | Runs when | Handy variables |
| - | - | - |
| When a message is posted | Someone sends a message | `{yp_content}`, `{yp_mentioned}` |
| When someone joins a server | A member joins | `{yp_member_count}`, `{yp_user_avatar}` |
| When someone leaves a server | A member leaves | `{yp_display_name}` |
| When someone adds a reaction | A reaction is added | `{yp_emoji}`, `{yp_message_id}` |
| When someone removes a reaction | A reaction is removed | `{yp_emoji}` |
| When someone clicks a button | A button is pressed | `{yp_custom_id}` |
| When someone joins voice | Someone joins a voice channel | `{yp_channel_id}` |
| When someone leaves voice | Someone leaves a voice channel | `{yp_channel_id}` |

Messages from bots never start events, so two bots can't answer each other forever.

## Filters on the trigger

Click the trigger block to narrow it down:

* **Server**: only in one server.
* **Channel**: only in one channel.
* **Keywords**: only messages that contain, start with or exactly match your words.
* **Only when mentioned**: only messages that mention your bot.
* **Emoji**: only one reaction.
* **Button ID starts with**: only certain buttons.

## Example: a keyword auto-reply

**1. Trigger**

**When a message is posted**, keywords `help, support`, match **Contains**.

**2. Answer**

Add a Message, set to reply: `Need help, {yp_user_mention}? Check #faq or open a ticket 🎟️`.

## Example: welcome card

**1. Trigger**

**When someone joins a server**, pick your server.

**2. Make the card**

Add **Make an image card** and pick a Card Studio welcome design.

**3. Send it**

Add a Message to your welcome channel with `Welcome {yp_user_mention}! You're member #{yp_member_count}` and `{card}` as the image.

> [!TIP]
>
> The [Welcome messages module](https://docs.dogebot.net/yapin/modules/overview.md) does this for you with no blocks at all.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.