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
- 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•17mo ago
Message Not Public
Sign In & Join Server To View
also update your djs version
Working now!
Oh I get it
because it will crash as i dont think 13.0.0 handles the new text in voice channels well
Hmmm
Unknown User•17mo ago
Message Not Public
Sign In & Join Server To View
Thank you all!
@thee2d @luna🌈, How can I make it like this? 🙂
Like 1 minute ago
etc
#rules 5 too