Finding a role

Im using command option to get a user, for instance /addrole @name, i created a member value but cant figure out how to get a role Everytime i try to execute the command it gives roles undefined I use " member.roles.add(OCS)" to add the role
4 Replies
d.js toolkit
d.js toolkit2y ago
• 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.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
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 * Note: Events received in cached guilds will often have both the member and user available, eg. interaction.user and interaction.member
MrFangs
MrFangsOP2y ago
i could have sworn i tried interaction im dumb tyyyy
Want results from more Discord servers?
Add your server