1.0.2 • Published 2 years ago
discord-spam-detector v1.0.2
discord.js-spam-detector
a spam detector for discord.js bots
Installation
npm install discord.js-spam-detector
Usage
const Discord = require('discord.js')
const spam = require('discord-spam-detector')
let client = new Discord.Client()
client.on('message', (message) => {
//initiate the detector and log the chats with max 50 logged chats
spam.log(message, 50)
if(spam.Time(3, 1000)){
// when someone send 3 chats in less than a second
}
if(spam.sameMessages(3, 60000)){
// when someone send 3 identical chats within a minute
}
})