Seeing if my bot disconnected with voiceStateUpdate

How through this listener can I check to see if my bot was in the voice channel prior to disconnecting (so I can do things after I know my bot was disconnected from a channel) 🤔
client.on("voiceStateUpdate", async (oldState, newState) => {
}
client.on("voiceStateUpdate", async (oldState, newState) => {
}
I've tried checking the oldState channelId but it always appears to be null. Am I doing something wrong? I'm wondering if my understanding of oldState vs newState is incorrect. Any help is greatly appreciated.
3 Replies
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs•3y ago
Documentation suggestion for @dzlandis:property VoiceState#member The member that this voice state belongs to
Dagan
Dagan•3y ago
This could maybe work

Did you find this page helpful?