issue with a lock channel command

  if(message.channel.permissionsFor(message.guild.id).has("SendMessages") === false) {
    message.channel.send({embeds: [errEmbed]}).then(a => {
      setTimeout(() => { message.delete(), a.delete() }, 3000)
  })


why the bot instead of sending the errEmbed when the channel is locked it just runs the rest of the code? (the bot should send the "errEmbed" only if the channel permission "SendMessages" is set to deny)
Was this page helpful?