From d72d5f5bdc9b8389a37a04823c09cc928c8252a2 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Mon, 13 Feb 2012 20:01:22 +0000 Subject: [PATCH] admin js command so admin can access dbot when running --- modules/js.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/js.js b/modules/js.js index 6286a1a..db63e4e 100644 --- a/modules/js.js +++ b/modules/js.js @@ -7,6 +7,13 @@ var js = function(dbot) { '~js': function(data, params) { var q = data.message.valMatch(/^~js (.*)/, 2); 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])); + } } };