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
• 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.<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
Great, thanks!