title: How to send a message if user has the permission
body: <p>Okay so, im trying to make an announce command that makes the bot say what the user asks it to write,
  the command is working fine but the main problem is that i dont want users that are not moderators/admins to use this command i tried to use <code>if (user.hasPermission(&quot;KICK_MEMBERS&quot;)</code> but i simply don't know how to implement this into my code, (here it is)</p>
  <pre><code>const Discord = require('discord.js');
  module.exports = {
      name: 'announce',
      description: &quot;announce&quot;,
      execute(message, args){
          const developerEmbed = new Discord.MessageEmbed()
          .setColor('#0099ff')
          .setTitle(`failed to send message`)
          .setAuthor('♥Aiko♥', 'https://i.imgur.com/1q9zMpX.png')
          .setDescription('please mention the channel first(if this promblem persists contact the developer)')
          .setTimestamp()
          .setFooter(`©Revenge#7005 | Requested by ${message.author.tag}.`);
          if(message.mentions.channels.size === 0) {
              message.channel.send(developerEmbed);
          }
          else {
              let targetChannel = message.mentions.channels.first();
      
              const args = message.content.split(&quot; &quot;).slice(2);
              let userMessage = args.join(&quot; &quot;);
              targetChannel.send(userMessage);
              message.delete();
              
          }
      }
  }
  </code></pre>
  <p>so yeah, any ideas how to make the bot check for the permission and then send the message if the user has it?
  i'm pretty new to coding and this bot is my first bigger project so sorry if this question seems stupid</p>