3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-18 00:22:35 +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) {
params = data.message.split(' ');
var params = data.message.split(' ');
if(data.channel == dbot.name) data.channel = data.user;
var ignoringCommand = false;

View File

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