<Member>.voice returns null
Heyhey, i've ran into an issue where whenever a member is connected to a channel when the bot starts or restarts, and then leaves, the old voicestate of that member will always be null. Any ideas on how to possbily prevent this?
6 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.v14.11.0, node 18.8.0
there isnt really much code i can use other than
which returns null
what about
oldState.channel
?
oldState.member.voice
just returns oldState
that returns the channel indeed, but the issue i face (i wrote this code yesterday evenying and i forgot how exactly i made it fucntion lmao) is that i need the member voicestate to determine whether the member that left the channel is the member that owned the channel (its one of those click to create voice channel things i'm making)
wait
i can just use oldState.member lmao
yeah
my brain is a diesel sometimes
classic case of creating an issue and by explaining it you actually find out whats wrong lol