I made a blacklist for the bot, it "works", it blocks the blacklisted user from using the bot but ended up causing a loop and the blacklisted message to get spammed, both when a blacklisted user uses it and when someone that isnt on the blacklist uses it
heres the code
client.on('message', async message => {
let blacklist = new Discord.MessageEmbed()
.setColor("#e31212")
.setDescription(
"ERROR: You are not allowed to use this bot | Reason: BLACKLISTED"
);
var blacklistids = ["402639792552017920", "711957885722296360"];
if (blacklistids.includes(message.author.id)) {
message.channel.send(blacklist).then(msg => {
msg.delete({ timeout: 3000 })
})
}
// Rest of the code
})