Package Exports
- tris-antispam
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tris-antispam) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
anti-spam-discord
a spam detector for discord.js bots
Usage
const Discord = require('discord.js')
const spam = require('tris-antispam')
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.tooQuick(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
}
})