title: How to fix "TypeError: message.member.hasPermission is not a function" in Discord.js?
body: <p>I was making Permissions Handler and I get the error &quot;TypeError: message.member.hasPermission is not a function&quot;. What's my mistake?</p>
  <pre><code>        const validPermissions = [
          &quot;CREATE_INSTANT_INVITE&quot;,
          &quot;KICK_MEMBERS&quot;,
          &quot;BAN_MEMBERS&quot;,
          &quot;ADMINISTRATOR&quot;,
          &quot;MANAGE_CHANNELS&quot;,
          &quot;MANAGE_GUILD&quot;,
      ]
  
      if(command.permissions.length){
          let invalidPerms = []
          for(const perm of command.permissions){
            if(!validPermissions.includes(perm)){
              return console.log(`Invalid Permissions ${perm}`);
            }
            if(!message.member.hasPermission(perm)){
              invalidPerms.push(perm);
            }
          }
          if (invalidPerms.length){
            return message.channel.send(`Missing Permissions: \`${invalidPerms}\``);
          }
  </code></pre>