TypeError Cannot read properties of undefined (reading 'cache')
I'm trying to make a user info command that returns the user's roles, however I seem to be running into that error when I try to run the command.
This is my code:
7 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
djs- [email protected]
node - v16.17.1
Users don't have roles, members do
Despite sounding similar there is a distinct difference between users and members in Discord:
• User: global Discord user data (global avatar, username, tag, id)
• GuildMember: user data associated to a guild (guild, nickname, roles, voice, guild avatar, etc.)
• Conversion: User ➞ GuildMember | GuildMember ➞ User
const user = interaction.options.getUser('user');
so this is where I replace?.getMember instead of .getUser
thanks a lot!