I am making a set nickname command and here is my code:
if (message.mentions.members.first().roles.highest.position > bot.user.roles.highest.position) return message.channel.send("My highest role is lower than the mentioned user's role");
But that code there is an error: Type error: Cannot read property of "highest" of undefined
I also tried this:
if (message.mentions.members.first().roles.highest.comparePositionTo(bot.user.roles.highest) > 0) {
return message.channel.send("Your highest role is lower than the mentioned user's role");
}
Any idea how to fix?