Answer the question
In order to leave comments, you need to log in
How can I force the bot to issue a role?
I want to force the bot to give a role to a user for certain achievements (for example, for reaching a certain level), please tell me the structure, or at least tell me how to give a role to a user by his id.
I tried to do something like this, but it doesn't work:
bot.on('guildMemberAdd', (guildMember) => {
if (levels[user.id].level >= 1) {
user.id.roles.add(guildMember.guild.roles.cache.find(role => role.name === 'уровень' + ' ' + '1'));
}
});
Answer the question
In order to leave comments, you need to log in
If you don't understand well enough, then you haven't read well enough.
(I read the documentation, and I did not understand very well)
user.id.roles.add(guildMember.guild.roles.cache.find(role => role.name === 'уровень' + ' ' + '1'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question