Open cayoten opened 4 years ago
well i'd just make my own anti-spam discord.js provides everything you need to make it
/* i use typescript btw */
const antispam = new Discord.Collection<string, string>();
/* ... */
client.on("message", async (message) => {
if (!antispam.has(message.author.id)) {
antispam.set(message.author.id, message.content);
setTimeout(() => { antispam.delete(message.author.id); }, 5000);
} else {
message.delete();
}
});
'course this is really simple and it would not scale well, but i use it sometimes for custom bots.
Keep in mind that setTimeout is inaccurate, especially if we're doing asynchronous nodejs :/
I realized that I am small brained and we could just use message.channel.awaitMessages(...)
There are tons of false positives being thrown, with emotes appearing to be one of the main causes. I’ve even had members say a single word in my server (hadn’t been on for hours), and they get flagged.
EDIT: The anti-spam even muted a member for sending a single image!
https://raimu.is-for.me/i/ao5pvewa.png