From 11cfa5d40c831f925bf8f9b283d71ace016184e2 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 30 Dec 2012 19:24:10 +0000 Subject: [PATCH] realityonce now just emits event. removed a lot of useless shit from there too --- modules/quotes/quotes.js | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/modules/quotes/quotes.js b/modules/quotes/quotes.js index 800fe72..14b9467 100644 --- a/modules/quotes/quotes.js +++ b/modules/quotes/quotes.js @@ -266,34 +266,18 @@ var quotes = function(dbot) { 'listener': function(event) { if(event.action == 'PRIVMSG') { - if((dbot.db.ignores.hasOwnProperty(event) && - dbot.db.ignores[event.user].include(name)) == false) { - if(event.user == 'reality') { - var once = event.message.valMatch(/^I ([\d\w\s,'-]* once)/, 2); - } else { - var once = event.message.valMatch(/^reality ([\d\w\s,'-]* once)/, 2); - } - - if(once) { - if((dbot.db.bans.hasOwnProperty('~qadd') && - dbot.db.bans['~qadd'].include(event.user)) || - dbot.db.bans['*'].include(event.user)) { - event.reply(dbot.t('command_ban', {'user': event.user})); - } else { - if(!dbot.db.quoteArrs.hasOwnProperty('realityonce')) { - dbot.db.quoteArrs['realityonce'] = []; - } - if(dbot.db.quoteArrs['realityonce'].include('reality ' + once[1] + '.')) { - event.reply(event.user + ': reality has already done that once.'); - } else { - dbot.db.quoteArrs['realityonce'].push('reality ' + once[1] + '.'); - addStack.push('realityonce'); - rmAllowed = true; - event.reply('\'reality ' + once[1] + '.\' saved.'); - } - } - } + if(event.user == 'reality') { + var once = event.message.valMatch(/^I ([\d\w\s,'-]* once)/, 2); + } else { + var once = event.message.valMatch(/^reality ([\d\w\s,'-]* once)/, 2); } + + if(once) { + event.message = '~qadd realityonce=reality ' + once[1]; + event.action = 'PRIVMSG'; + event.params = event.message.split(' '); + dbot.instance.emit(event); + } } else if(event.action == 'JOIN') { event.message = '~q ' + event.user; event.action = 'PRIVMSG';