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
|