Add a role to a message author

Hi there, trying to add a role to the user that sends a message. This happens on the messageCreate event. Not sure what I'm doing wrong. Any ideas? Thanks!
3 Replies
d.js docs
d.js docs3y 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.
Idris
Idris3y ago
<Message>.author returns a User instance if you check the doc you can see that there is no property named roles on the User class only GuildMembers have roles you can access the GuildMember instance of the message’s author using <Message>.member
WreckNoFear
WreckNoFearOP3y ago
Great, thanks!
Want results from more Discord servers?
Add your server