I presume the reason this is not working is because the if(foundInText) runs instantly, while the code checks the message, so you could do this instead:
let blacklisted = [
“1”,
“2”
];
for (var i in blacklisted) {
if (message.content.toLowerCase().includes(blacklisted[i].toLowerCase()))
foundInText()
}
function foundInText() {
message.delete();
message.channel.send(“test :rage:”).then(msg => msg.delete(5000));
}
});