I'm making a discord bot and I'm trying to make a forbidden words list using arrays. I can't seem to find out how to make this work. Here's my current code:
if (forbidenWords.includes(message.content)) {
message.delete();
console.log(colors.red(`Removed ${message.author.username}'s Message as it had a forbidden word in it.`));
}
If you can't tell, I'm trying to check if the user's message has anything that's in the array forbidenWords
and remove it. How do I do this?