3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 22:39:26 +01:00

admin js command so admin can access dbot when running

This commit is contained in:
Luke Slater 2012-02-13 20:01:22 +00:00
parent b34d714364
commit d72d5f5bdc

View File

@ -7,6 +7,13 @@ var js = function(dbot) {
'~js': function(data, params) { '~js': function(data, params) {
var q = data.message.valMatch(/^~js (.*)/, 2); var q = data.message.valMatch(/^~js (.*)/, 2);
dbot.say(data.channel, vm.runInNewContext(q[1])); dbot.say(data.channel, vm.runInNewContext(q[1]));
},
'~ajs': function(data, params) {
var q = data.message.valMatch(/^~ajs (.*)/, 2);
if(data.user == dbot.admin) {
dbot.say(data.channel, eval(q[1]));
}
} }
}; };