1let role = message.guild.roles.cache.find(r => r.id === "Role ID");
2
3// The member you want to add the role to
4let member = message.mentions.members.first();
5
6// Add role to the member
7member.roles.add(role);
8
9// Or add it to yourself
10message.author.roles.add(role);
11
1//outputs the IDs of all members with the specified role as an array
2
3// === discord.js v11 ===
4message.guild.roles.get('ROLE-ID').members.map(m=>m.user.id);
5
6// === discord.js v12 ===
7message.guild.roles.cache.get('ROLE-ID').members.map(m=>m.user.id);