title: TypeError: Cannot read properties of undefined (reading 'hasPermission')
body: <p>I am back again with again my ticket function. This time I am working on a close command. Whatever I try I always come back at the same errors:</p>
  <pre><code>TypeError: message.member.hasPermission is not a function
  </code></pre>
  <p>Anyone who can look at the code?</p>
  <pre><code>    const { MessageEmbed, Collection, Permissions } = require ('discord.js');
  
  module.exports = {
      name: 'close',
      description: &quot;closes the ticket&quot;,
      execute(message, args, client){
          if(!message.member.hasPermission(&quot;MANAGE_CHANNELS&quot;)) return message.channel.send(&quot;Only a moderator can end a ticket!&quot;)
  
          if(message.member.hasPermission(&quot;MANAGE_CHANNELS&quot;)) message.channel.delete()
      }
  }
  </code></pre>