> ## 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.

# Member events

> These run when people join, leave, get banned, get roles, change their nickname or change their status.

These run when people join, leave, get banned, get roles, change their nickname or change their status.

> **[Example](/build-real-systems/welcome-messages-and-cards)**
>
> Say hello to new members, or give everyone a role when they join. See Welcome messages and cards.

> [!NOTE]
>
> **How to use one:** go to **Events**, press **New Event**, pick the event from the list, then add blocks under it. The words in `{curly brackets}` are variables you can type into your blocks.

> [!NOTE]
>
> For join and leave events, turn on the **Server Members Intent** for your bot in the Discord Developer Portal.

## Variables every member event has

Every event on this page has the person and server variables. Some have extra ones, listed in each event below.

**About the person**

| Type this | What you get |
| - | - |
| `{event_user_avatar}` | A link to their profile picture |
| `{event_user_id}` | Their ID |
| `{event_user_mention}` | Pings them |
| `{event_user_name}` | Their username |
| `{event_user_tag}` | Their full tag |
| `{event_user_username}` | Their username |

**About the server**

| Type this | What you get |
| - | - |
| `{event_guild_id}` | The server ID |
| `{event_guild_name}` | The server name |

## The events

> **When a new user joins the server**
>
> **When it runs:** someone joins your server.
>
> **Extra variables:** none. Use `{event_user_mention}` to say hello.
>
> **Build idea:** a welcome message or card, and a starting role. See [Welcome messages and cards](/build-real-systems/welcome-messages-and-cards).

> **When a user leaves or is kicked from the server**
>
> **When it runs:** someone leaves, or is kicked.
>
> **Extra variables:** none.
>
> **Build idea:** say goodbye in a channel.

> **When a user is banned from the server**
>
> **When it runs:** someone is banned.
>
> | Type this | What you get |
> | - | - |
> | `{event_ban_reason}` | Why they were banned |
>
> **Build idea:** post the ban and its reason in your log channel.

> **When a user is unbanned from the server**
>
> **When it runs:** someone's ban is taken away.
>
> **Extra variables:** none.

> **When a role is added to a user**
>
> **When it runs:** someone gets a role.
>
> | Type this | What you get |
> | - | - |
> | `{event_role_id}` | The role ID |
> | `{event_role_name}` | The role name |
>
> **Build idea:** say thank you when someone gets your supporter role.

> **When a role is removed from a user**
>
> **When it runs:** someone loses a role.
>
> | Type this | What you get |
> | - | - |
> | `{event_role_id}` | The role ID |
> | `{event_role_name}` | The role name |

> **When a user changes their nickname**
>
> **When it runs:** someone changes their nickname in your server.
>
> | Type this | What you get |
> | - | - |
> | `{event_new_nickname}` | The new nickname |
> | `{event_old_nickname}` | The old nickname |
>
> **Build idea:** log nickname changes for your moderators.

> **When a user's status changes**
>
> **When it runs:** someone's status changes.
>
> | Type this | What you get |
> | - | - |
> | `{event_new_status}` | The new status |
> | `{event_old_status}` | The old status |

> **When member passes membership screening**
>
> **When it runs:** someone accepts your server's rules screen.
>
> **Extra variables:** none.
>
> **Build idea:** give them a member role once they accept the rules.

## Example

Under **When a new user joins the server**, a message block says:

```text theme={null}
Welcome {event_user_mention} to {event_guild_name}!
```

The bot shows: **Welcome @Sam to Doge Town!**

> [!TIP]
>
> Looking for when a role is made or deleted in the server? That's on [Role, boost and invite events](/event-triggers/role-boost-and-invite-events).


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