messageCreate event

anyone got any clue why this aint working?
client.on('messageCreate', (message) => {
  if (message.mentions.has(message.guild.members.cache.find((member) => member.hasPermission('ADMINISTRATOR')))) {
    message.delete();

    const warningEmbed = new Discord.MessageEmbed()
      .setColor('RED')
      .setTitle('Warning')
      .setDescription(`You cannot ping an administrator in this server. Your message has been deleted.`)
      .setTimestamp();

    message.author.send({ embeds: [warningEmbed] });
  }
});


its supposed to detect when a member pings someone with administrator then delete the ping adn send a warning embed but.. it just doesnt
Was this page helpful?