dont print result of ajs if its undefined

This commit is contained in:
Luke Slater 2012-03-10 14:56:06 +00:00
parent d5296b0ea0
commit 28f78373d8

View File

@ -15,8 +15,11 @@ var js = function(dbot) {
'~ajs': function(data, params) { '~ajs': function(data, params) {
var q = data.message.valMatch(/^~ajs (.*)/, 2); var q = data.message.valMatch(/^~ajs (.*)/, 2);
if(dbot.admin.include(data.user)) { if(dbot.admin.include(data.user) ) {
dbot.say(data.channel, eval(q[1])); var ret = eval(q[1]);
if(ret != undefined) {
dbot.say(data.channel, ret);
}
} }
} }
}; };