From 28f78373d855c923d8f807a8831ef0dd5d5714f1 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Sat, 10 Mar 2012 14:56:06 +0000 Subject: [PATCH] dont print result of ajs if its undefined --- modules/js.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/js.js b/modules/js.js index 3a5ee5f..cf08699 100644 --- a/modules/js.js +++ b/modules/js.js @@ -15,8 +15,11 @@ var js = function(dbot) { '~ajs': function(data, params) { var q = data.message.valMatch(/^~ajs (.*)/, 2); - if(dbot.admin.include(data.user)) { - dbot.say(data.channel, eval(q[1])); + if(dbot.admin.include(data.user) ) { + var ret = eval(q[1]); + if(ret != undefined) { + dbot.say(data.channel, ret); + } } } };