voiceJoin events run:
src/events/hello.ts
voice and the server, guild: voice.member is who joined, voice.channel the VoiceChannel (a stage channel is one too, with channel.isStage), and voice.state their VoiceState: muted, deafened, streaming, camera on…
The four voice events, with what they give, are in the reference. Your bot joining a voice channel itself, to play sound there, is in Playing in voice.
Four events
Discord sends one kind of change for voice; ChapterJS tells you what it was, by comparing with what the person was doing before:
A move is only a
voiceMove: not a voiceLeave followed by a voiceJoin. And voiceUpdate never runs for a join, a leave or a move.
src/events/live.ts
The channel someone left
voiceLeave always gives the channel, even when it was deleted with people in it: the bot keeps the channel of each person while they are in voice.
src/events/empty.ts
What the bot remembers
To tell a join from a move or a mute, the bot remembers who is in a voice channel, and forgets them when they leave. It only does when a file listens to one of these events: without one, Discord does not send voice changes at all. It is little: one small entry per person in voice right now.Intents
The four events needGUILD_VOICE_STATES, which is not privileged. They only happen in servers: there is no where option.
Moderation and the server
Bans, the audit log, invites, emojis, scheduled events, threads.
Events reference
Every field of every event.