I'm making a kick slashCommand in discord.js v13 and i was trying to compared the user roles and the target role but it doesn't work, I don't know why is that
here's my code:
If(interaction.member.highest.comparePositionTo(target.roles.highest.position > 0)) {
const kickErr = new MessageEmbed()
.setDescription(`You cannt kick this member because their role is higher/equal to yours.`)
.setColor(ee.color)
return interaction.reply({ embeds: [kickErr] })
} else if (interaction.guild.me.roles.highest.comparePositionTo(target.roles.highest.position > 0)) {
const kickErr2 = new MessageEmbed()
.setDescription(`I cannot kick this member because their role is higher/equal to mine.`)
.setColor(ee.color)
return interaction.reply({ embeds: [kickErr2] })
}