Answer the question
In order to leave comments, you need to log in
How to write a role to a variable?
How to write a role to a variable?
Tried:
let role = member.guild.roles.find(r => r.name = "Имя роли");
member.addRole(role)
Answer the question
In order to leave comments, you need to log in
member.addRole(role.id); - discord.js v11
member.roles.add(role.id); - discord.js v12
you write the variable incorrectly, you simply didn’t transfer member.addRole(role)
read this , then try to run the code again. You can also try using a function
instead of a variable .
if nothing from this list helped you, please write a comment under my answer with the error code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question