how to check if a user has a role in discord.js v12 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: if member has role discord.js
let allowedRole = message.guild.roles.find("name", "rolename");
if (message.member.roles.has(allowedRole.id) {
// allowed access to command
} else {
// not allowed access
})