discord.js how to give permission using id code example
Example 1: check member role discordjs 12
if (message.member.roles.find(r => r.name === "ROLE_NAME")) {
//Rest of your code
}
Example 2: discord.js get all members with role
//outputs the IDs of all members with the specified role as an array
// === discord.js v11 ===
message.guild.roles.get('ROLE-ID').members.map(m=>m.user.id);
// === discord.js v12 ===
message.guild.roles.cache.get('ROLE-ID').members.map(m=>m.user.id);