The blacklisted words are bad words but the words that appear on whitelisted are really clean words but the bot detects them too as a bad word. How can I solve this?
Thanks in advance.
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Bot is online!');
});
const prefix = '&';
client.on('message', message => {
let blacklisted = ['bad words'];
let whitelisted = ['clean words'];
let foundInText = false;
for (var i in blacklisted) {
if(message.content.toLowerCase().includes(blacklisted[i].toLowerCase())) foundInText = true;
}
if(foundInText){
message.delete();
const embed = new Discord.MessageEmbed()
.setTitle('W A R N')
.setDescription(message.author.toString() + ' we don't allow to write this here.')
.setThumbnail('logo link')
.setAuthor(client.user.username)
.setColor('RANDOM')
.addFields(
{name: 'Explain' , value: 'explainv2.' + '
' + 'The bad word: ' + '**' + message.toString() + '**'},
)
message.channel.send(embed)
.then(message => message.delete({ timeout: 15000}))
}
});
client.login('discord bot id');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…