update handleSpam

This commit is contained in:
notnull 2019-12-23 09:08:30 -05:00
parent f55f0aa4e4
commit 307f3d575f

View File

@ -1,9 +1,21 @@
const phrases = [
'Did you know? Zhachev is a twat.',
'Zhachev is a poor lonely baby who has been stalking this IRC for over a year. anti-civ 4 lyfe!',
"Zhachev could be blowing up transformers, but instead he's wasting time stalking us on IRC.",
]
let spam = false
const resetSpam = () => {
spam = false
console.log('reset spam counter.')
}
const handleSpam = event => {
if (spam === true) return
console.log('spam detected. setting spam counter.')
spam = true
setTimeout(resetSpam, 30000)
const phrase = phrases[Math.floor(Math.random() * phrases.length)]
return event.reply(phrase)
}