forked from GitHub/dbot
realityonce now just emits event. removed a lot of useless shit from there too
This commit is contained in:
parent
ae902e3c21
commit
11cfa5d40c
@ -266,8 +266,6 @@ var quotes = function(dbot) {
|
|||||||
|
|
||||||
'listener': function(event) {
|
'listener': function(event) {
|
||||||
if(event.action == 'PRIVMSG') {
|
if(event.action == 'PRIVMSG') {
|
||||||
if((dbot.db.ignores.hasOwnProperty(event) &&
|
|
||||||
dbot.db.ignores[event.user].include(name)) == false) {
|
|
||||||
if(event.user == 'reality') {
|
if(event.user == 'reality') {
|
||||||
var once = event.message.valMatch(/^I ([\d\w\s,'-]* once)/, 2);
|
var once = event.message.valMatch(/^I ([\d\w\s,'-]* once)/, 2);
|
||||||
} else {
|
} else {
|
||||||
@ -275,24 +273,10 @@ var quotes = function(dbot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(once) {
|
if(once) {
|
||||||
if((dbot.db.bans.hasOwnProperty('~qadd') &&
|
event.message = '~qadd realityonce=reality ' + once[1];
|
||||||
dbot.db.bans['~qadd'].include(event.user)) ||
|
event.action = 'PRIVMSG';
|
||||||
dbot.db.bans['*'].include(event.user)) {
|
event.params = event.message.split(' ');
|
||||||
event.reply(dbot.t('command_ban', {'user': event.user}));
|
dbot.instance.emit(event);
|
||||||
} 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.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if(event.action == 'JOIN') {
|
} else if(event.action == 'JOIN') {
|
||||||
event.message = '~q ' + event.user;
|
event.message = '~q ' + event.user;
|
||||||
|
Loading…
Reference in New Issue
Block a user