forked from GitHub/dbot
dont print result of ajs if its undefined
This commit is contained in:
parent
d5296b0ea0
commit
28f78373d8
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user