eris-antispam
v1.0.0
Published
A npm package for discord bots made with eris
Downloads
4
Maintainers
Readme
eris-antispam
A npm package for discord bots made with eris https://npmjs.com/package/eris
Quick setup
const eris = require("eris");
const bot = new eris("TOKEN")
const erisAntiSpam = require("eris-antispam");
const erisAntiSpamClient = new erisAntiSpam({
//Options
});
bot.on("messageCreate", async msg => {
erisAntiSpamClient.onMessage(msg)
});
erisAntiSpamClient.on("warnEmit", (member, channelID, guildID, authorCache) => {
//Emits on warnEmit, Default is 3 messages spammed
})
erisAntiSpamClient.on("spamEmit", (member, channelID, guildID, authorCache) => {
//Emits on spamEmit, Default is 5 messages spammed
})
erisAntiSpamClient.on("heavySpamEmit", (member, channelID, guildID, authorCache) => {
//Emits on heavySpamEmit, Default is 7 messages spammed
})
bot.connect()
Options
warnEmit: Number Default: 3 //How many messages in your options.fetchedCacheTimeLimit before the warnEmit is emited
spamEmit: Number Default: 5 //How many messages in your options.fetchedCacheTimeLimit before the spamEmit is emited
heavySpamEmit: Number Default: 7 //How many messages in your options.fetchedCacheTimeLimit before the heavySpamEmit is emited
ignoreBots: Boolean, Default: true //If true the bot will not emit on bot spam
ignoreUsers: Array, Default: [] //Users to not emit spam on
ignoreChannels: Array, Default: [] //Channels to not emit on
ignoreRoles: Array, Default: [] //Roles to not emit on, If a member has one of the roles in the array it will not emit
ignorePerms: Array, Default: [] //Permissions to not emit on, If a member has one of the permissions it will not emit
resetCache: Number, Default: 1800000 //how long in mili seconds to reset the cache
fetchedCacheTimeLimit: Number, Default: 4000 //How old a message can be to be couted to spam amout
actionCooldowns: Number, Default: 8000 //Min amout of time in mili seconds events can emit