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) } module.exports = handleSpam