3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-18 08:32:42 +01:00

fix split on undefined message in puns

This commit is contained in:
Luke Slater 2012-03-14 15:47:00 +00:00
parent c22f869d15
commit 8f891835e4
2 changed files with 4 additions and 6 deletions

View File

@ -34,7 +34,7 @@ var command = function(dbot) {
}; };
}, },
'listener': function(data) { 'listener': function(data) {
params = data.message.split(' '); var params = data.message.split(' ');
if(data.channel == dbot.name) data.channel = data.user; if(data.channel == dbot.name) data.channel = data.user;
var ignoringCommand = false; var ignoringCommand = false;

View File

@ -4,14 +4,12 @@ var puns = function(dbot) {
return { return {
'listener': function(data) { 'listener': function(data) {
if(dbot.moduleNames.include('quotes')) { if(dbot.moduleNames.include('quotes')) {
if(data.user == 'reality') { if(dbot.db.quoteArrs.hasOwnProperty(data.user.toLowerCase())) {
data.message = '~q realityonce';
} else if(dbot.db.quoteArrs.hasOwnProperty(data.user.toLowerCase())) {
data.message = '~q ' + data.user.toLowerCase(); data.message = '~q ' + data.user.toLowerCase();
}
var params = data.message.split(' '); var params = data.message.split(' ');
dbot.commands[params[0]](data, params); dbot.commands[params[0]](data, params);
} }
}
}, },
'on': 'JOIN' 'on': 'JOIN'