add handleSpam
This commit is contained in:
parent
17b3cc0c42
commit
f55f0aa4e4
11
src/handleSpam.js
Normal file
11
src/handleSpam.js
Normal file
@ -0,0 +1,11 @@
|
||||
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!',
|
||||
]
|
||||
|
||||
const handleSpam = event => {
|
||||
const phrase = phrases[Math.floor(Math.random() * phrases.length)]
|
||||
return event.reply(phrase)
|
||||
}
|
||||
|
||||
module.exports = handleSpam
|
@ -3,6 +3,9 @@ const chalk = require('chalk')
|
||||
require('dotenv').config()
|
||||
const { insertTrack } = require('./mpc-commands')
|
||||
|
||||
let request = ''
|
||||
const handleSpam = require('./handleSpam')
|
||||
|
||||
const CLIENT_ID = process.env.CLIENT_ID
|
||||
const CLIENT_SECRET = process.env.CLIENT_SECRET
|
||||
|
||||
@ -47,6 +50,9 @@ const searchTrack = event => {
|
||||
}
|
||||
|
||||
const requestTrack = event => {
|
||||
if (event.message === request) return handleSpam(event)
|
||||
|
||||
request = event.message
|
||||
let pattern = /^!request "(.+?)"( artist "(.+?)")?/
|
||||
let match = event.message.match(pattern)
|
||||
if (!match)
|
||||
|
Loading…
Reference in New Issue
Block a user