3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 19:52:36 +01:00

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) {
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);
}
}
}
};