Voice Events
Voice events fire when members join, leave, or change voice channels. Use them to welcome voice users, update voice channel status, or log voice activity.
Available Voice Events
Section titled “Available Voice Events”Member Joins Voice
Section titled “Member Joins Voice”Triggered when a member joins any voice channel:
on member voice join: set {_member} to event-member set {_channel} to event-channel
# Log the join broadcast "%{_member}% joined voice channel %{_channel}%"Event values:
event-member— Member who joinedevent-channel— Voice channel they joinedevent-guild— Guild where it happened
Member Leaves Voice
Section titled “Member Leaves Voice”Triggered when a member leaves a voice channel:
on member voice leave: set {_member} to event-member set {_channel} to event-channel
# Log the leave broadcast "%{_member}% left voice channel"Event values:
event-member— Member who leftevent-channel— Voice channel they left (if available)event-guild— Guild where it happened
Member Moves Voice
Section titled “Member Moves Voice”Triggered when a member switches between voice channels:
on member voice move: set {_member} to event-member set {_from} to old channel set {_to} to new channel
broadcast "%{_member}% moved from %{_from}% to %{_to}%"Event values:
event-member— Member who movedold channel— Channel they leftnew channel— Channel they joinedevent-guild— Guild where it happened
Practical Examples
Section titled “Practical Examples”Voice Welcome Message
Section titled “Voice Welcome Message”Announce when users join a specific voice channel:
on member voice join: if event-channel is voice channel "General": set {_msg} to "%mention tag of event-member% joined voice!" post {_msg} to text channel "voice-logs"Voice Session Tracker
Section titled “Voice Session Tracker”Track how long members are in voice:
on member voice join: set {voice.%discord id of event-member%.join_time} to now
on member voice leave: set {_join} to {voice.%discord id of event-member%.join_time} if {_join} is set: set {_duration} to difference between now and {_join} broadcast "%event-member% was in voice for %{_duration}%"Voice Channel Status Updates
Section titled “Voice Channel Status Updates”Update the channel status when members join/leave:
on member voice join: set {_count} to size of members in event-channel set status of event-channel to "%{_count}% members in voice"
on member voice leave: set {_count} to size of members in event-channel set status of event-channel to "%{_count}% members in voice"Self-Destruct Voice Channels
Section titled “Self-Destruct Voice Channels”Delete voice channels when the last member leaves:
on member voice leave: if size of members in event-channel is 0: if name of event-channel starts with "Temporary": delete event-channel broadcast "Deleted empty temporary voice channel"Common Patterns
Section titled “Common Patterns”Check if Member is in Voice
Section titled “Check if Member is in Voice”if event-member is in voice: # Member is currently in a voice channel set {_vc} to voice channel of event-memberGet All Members in a Channel
Section titled “Get All Members in a Channel”set {_members::*} to members in voice channel "General"broadcast "Members in voice: %{_members::*}%"Voice Channel Info
Section titled “Voice Channel Info”Access voice channel properties:
set {_vc} to voice channel "Gaming"
# Channel propertiesset {_name} to name of {_vc}set {_limit} to user limit of {_vc}set {_members} to members in {_vc}set {_bitrate} to bitrate of {_vc}Best Practices
Section titled “Best Practices”- Be respectful — Don’t be too intrusive with voice notifications
- Use private channels — Log voice events in a mod-only channel
- Handle edge cases — Members might move quickly between channels
- Rate limit messages — Don’t spam updates for every voice change
- Clean up data — Remove old voice tracking data regularly
Troubleshooting
Section titled “Troubleshooting”Voice Events Not Firing
Section titled “Voice Events Not Firing”- Ensure your bot has proper intents enabled (Guild Voice States)
- Check that you’re handling the correct event name
- Verify the channel is actually a voice channel
Can’t Access Event Values
Section titled “Can’t Access Event Values”- Use
event-membernotevent-userfor voice events - Voice channels are accessed via
event-channelnot text channels - Some properties may only be available during specific events
Related
Section titled “Related”- Learn about Guild Management
- Explore Member Management
- Understand Event Handling