S
S
scriptnet hello2020-10-27 19:42:30
Node.js
scriptnet hello, 2020-10-27 19:42:30

How to give a role in a discord.js bot?

How to issue a role knowing only role id and member id?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-10-27
@scriptnet

var role = message.guild.roles.cache.find(role => role.id === "id_роли");
var user = message.guild.members.cache.get('id_пользователя');
user.roles.add(role)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question