Direct message not being sent

The bot is supposed to send a direct message to the user if he used a blacklisted word in his message. I’m using discord.js@13.0.0.

Part of the code:
client.on('messageCreate', async (message) => {
if (message.author.bot) return;

if (blacklist.some(word => message.content.toLowerCase().includes(word))) {
handleBlacklistedWord(message);
}
});

async function handleBlacklistedWord(message) {
await message.delete();

const duration = 'Undefined, temporary.';
const reason = 'Using blacklisted words.';

const userEmbed = new MessageEmbed()
.setTitle('You have been muted.')
.setDescription(You used a blacklisted word in your message. Moderators will review the message to make the final decision.\n**Duration - ** ${duration}\n**Reason - ** ${reason}\n**Message Content - ** \${message.content}``)
.setColor('#aeaba8')
.setFooter('Auto-Moderator');

Thank you.
Was this page helpful?