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 [email protected]. 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.
13 Replies
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
treble/luna
treble/luna17mo ago
also update your djs version
Ali
AliOP17mo ago
Working now!
Ali
AliOP17mo ago
Oh I get it
treble/luna
treble/luna17mo ago
because it will crash as i dont think 13.0.0 handles the new text in voice channels well
Ali
AliOP17mo ago
Hmmm
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Ali
AliOP17mo ago
Thank you all!
Ali
AliOP17mo ago
@thee2d @luna🌈, How can I make it like this? 🙂
Ali
AliOP17mo ago
Like 1 minute ago etc
d.js docs
d.js docs17mo ago
guide Popular Topics: Timestamps read more
treble/luna
treble/luna17mo ago
#rules 5 too
Want results from more Discord servers?
Add your server