title: How to check if a member can be kicked/banned in discord.js v12?
body: <p>I have created a ban command that works fine, unless you try to kick someone with a higher role than the bot. Is there a simple way of checking if the user can be kicked? I tried checking if the client has higher roles than the person, but then it fails when you try to kick the owner of the server if he has no roles. My code is here:</p>
  <pre><code>        var User = message.guild.member(message.mentions.members.first()) || message.guild.members.cache.get(args[0]);
          if (!User) return message.reply(&quot;please mention the one who should be banned&quot;)
          if(User.id === message.author.id) {
              return message.reply('can not allow self-harm')
          };
          if (message.member.roles.highest.comparePositionTo(User.roles.highest) &lt;= 0) {
              return message.reply('you can not ban a user with the same (or higher) permissions as you')
          };
          var banReason = args
          banReason.shift()
          banReason = banReason.toString()
          banReason = banReason.replace(/,/g, ' ')
  
          if (!banReason) {
              banReason = &quot;No reason provided&quot;
          };
          var banReason2 = `Banned by ${message.author.tag} -` + ' ' + banReason
          User.ban({reason: banReason2}).catch(error =&gt; {
              message.channel.send(`Failed to ban &lt;@${User.id}&gt;`)
              return console.log(error)
          })
  
          message.reply(`you have succesfully banned &lt;@${User.id}&gt; with the reason **${banReason}** &lt;a:excitedwave:758043553573372117&gt;`);
  
          const embed = new Discord.MessageEmbed()
  
          .setColor('#FF0000')
          .setTitle(`You have been banned from ${message.guild.name}`)
          .setDescription(`**Banned by:** &lt;@${message.author.id}&gt;\n**Ban reason:** ${banReason}`)
          .setTimestamp()
  
          User.user.send(embed).catch(error =&gt; {
              message.channel.send(`Failed to DM &lt;@${User.id}&gt; the info about this action`)
              console.log(error)
          })
  </code></pre>
  <p>Thanks in advance</p>