voicestate is undefined

client.on('voiceStateUpdate', (oldState, newState) => {
voiceClient.startListener(oldState, newState);
console.log(voiceClient.getUserData(client.guilds.cache.get(guildID).members.cache.get(newState.id)))
})
client.on('voiceStateUpdate', (oldState, newState) => {
voiceClient.startListener(oldState, newState);
console.log(voiceClient.getUserData(client.guilds.cache.get(guildID).members.cache.get(newState.id)))
})
Inside of the console.log() I am trying to log the user data of the state's user, but as I try and do that, I get an error saying Can't read properties of undefined reading 'id', yet, When I try and log the voiceState it logs fine. Am I doing something wrong here?
3 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Syjalo
Syjalo3y ago
We already told you this is an issue of djs-voice. It's not related to discord.js. We can't help you. Libraries that related to discord.js is discord.js it self and libraries that starts with @discordjs. Other libraries are third party. We don't know how they work and how to solve their issues.
DanielBA
DanielBAOP3y ago
I have asked there as well. they sent me to the general questions chat
Want results from more Discord servers?
Add your server