Quote:
When I was designing a bot for Discord, I got an error from a piece of code.I've tried everything, including debugs, but I can't find a solution.
client.on("message", msg => {
db.fetch(`advertise_${msg.guild.id}`).then(i => {
if (i == 'open') {
const advertise = [".com", ".net", ".xyz", ".tk", ".pw", ".io", ".me", ".gg", "www.", "https", "http", ".gl", ".org", ".com.tr", ".biz", "net", ".rf.gd", ".az", ".party", "discord.gg"];
if (reklam.some(word => msg.content.includes(word))) {
try {
if (!msg.member.hasPermission("BAN_MEMBERS")) {
msg.delete();
return msg.reply('Do Not Advertise!').then(msg => msg.delete(3000));
msg.delete(3000);
}
} catch(err) {
console.log(err);
}
}
}
else if (i == 'closed') {
}
if (!i) return;
})
});
What I have tried:
const advertise = [".com", ".net", ".xyz", ".tk", ".pw", ".io", ".me", ".gg", "www.", "https", "http", ".gl", ".org", ".com.tr", ".biz", "net", ".rf.gd", ".az", ".party", "discord.gg"];