mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-01 22:55:40 -05:00
13 lines
357 B
JavaScript
13 lines
357 B
JavaScript
function messagelimit (bot, options) {
|
|
let spamCount = 0
|
|
setInterval(() => spamCount = 0, 1000 * 2)
|
|
|
|
bot.on('message', message => {
|
|
if (message == (`${bot.options.commands.prefix} `) && spamCount > 300) {
|
|
bot.tellraw('WTF spam detected rate limiting')
|
|
return
|
|
}
|
|
spamCount++
|
|
})
|
|
}
|
|
module.exports = messagelimit |