So, I'm creating a command in which I need to send a specific message when the user pinged in the command has a certain role. The only thing I could come up with was this:
if(message.mentions.users.first().roles.cache.some(r => r.name === "Admin" || "Mod")) {
message.channel.send('This user has a role!')
}
I'm stuck in place and can't find a way to deal with it. The answer is probably obvious but with my JavaScript skills, I'm getting more and more frustrated with every change I make.
Also, this is the error that I get: "TypeError: Cannot read property 'cache' of undefined"