TypeError Cannot read properties of undefined (reading 'id')
I get the error
TypeError: Cannot read properties of undefined (reading 'tag')
when I try to collect users, how do I fix it?
3 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.It cannot find interaction.guild.members.fetch(array[i].id.split('_')[2])
Try printing interaction.guild.members then array, then array[i] etc.
It may help us if we get the output from console.log(array)
And array could be a keyword.
Try renaming the array variable.
fetch returns promise of memebr
if not error