VoiceState channelId is null
When leaving a voice channel, both the oldState.channelId and newState.channelId are null.
djs v14.3.0, node 18.8.0
Bot has all the required intents enabled, and works fine when joining a channel (join to create voice bot).
I also noticed that when connecting to a channel, both the old and newState have the same channelId
2 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.full code:
no, the event fires only one when joining a voice channel. It does fire again once it moves to the channel which was created
when doing that, it does indeed work (maybe i made a typing error somewhere before). But, it keeps throwing an error at the member.voice.channel.id, because 'voice' apparently is null in both cases
ahh that explains. i honestly dont know and just realised i can do it via the channelId instead. i tried it because initially the channelId property didnt work (probably misspelled) and i tried it via there.
(my issues can be very stupid/simple sometimes but i only realise that afterwards)