update handleSpam
This commit is contained in:
parent
f55f0aa4e4
commit
307f3d575f
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user