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

# Voice events

> These run when people join, leave or move between voice channels, mute, deafen or start streaming.

These run when people join, leave or move between voice channels, mute, deafen or start streaming.

> **Example**
>
> Post a message when someone joins the music channel, or count minutes spent in voice.

> [!NOTE]
>
> **How to use one:** go to **Events**, press **New Event**, pick the event from the list, then add blocks under it.

## Variables every voice event has

**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 and voice channel**

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

## The events

> **When a member joins a voice channel**
>
> **When it runs:** someone hops into voice.
>
> **Variables:** the shared ones above.
>
> **Build idea:** say hi in a text channel, or save the time they joined to count their voice minutes.

> **When a member leaves a voice channel**
>
> **When it runs:** someone leaves voice.
>
> **Variables:** the shared ones above.
>
> **Build idea:** work out how long they stayed (see the tip below).

> **When a member switches voice channels**
>
> **When it runs:** someone moves from one voice channel to another.
>
> **Variables:** the shared ones above. Plus:
>
> | Type this | What you get |
> | - | - |
> | `{event_old_channel_id}` | The voice channel they left |
> | `{event_new_channel_id}` | The voice channel they moved to |

> **When a user starts or stops streaming in voice**
>
> **When a user starts streaming in voice** runs when someone starts sharing their screen. **When a user stops streaming in voice** runs when they stop sharing.
>
> **Variables:** the shared ones above.
>
> **Build idea:** tell everyone that someone is live in voice.

> **When a member is server muted or unmuted**
>
> **When it runs:** a moderator mutes or unmutes them.
>
> **Variables:** the shared ones above.
>
> **Build idea:** log who was muted in your log channel.

> **When a member self mutes or self unmutes**
>
> **When it runs:** they mute or unmute their own microphone.
>
> **Variables:** the shared ones above.

> **When a member is server deafened or undeafened**
>
> **When it runs:** a moderator deafens or undeafens them.
>
> **Variables:** the shared ones above.

> **When a member self deafens or self undeafens**
>
> **When it runs:** they deafen or undeafen themselves.
>
> **Variables:** the shared ones above.

> [!TIP]
>
> **Counting voice minutes:** save `{time_now_unix}` in a User variable when someone joins, then when they leave, work out `{time_now_unix}` take away that number and divide by 60. That's how many minutes they stayed.

## Example

Under **When a member joins a voice channel**, a message block in your chat channel says:

```text theme={null}
{event_user_mention} joined {event_voice_channel_name}!
```

The bot shows: **@Sam joined Music!**


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