3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-24 04:49:25 +01:00
dbot/modules/js.js
Luke Slater b76f3ff70c js
2011-10-12 16:48:54 +01:00

22 lines
423 B
JavaScript

var js = function(dbot) {
var dbot = dbot;
var commands = {
'~js': function(data, params) {
var q = data.message.valMatch(/^~js ([\d\w\s]*)/, 2);
console.log(q[1]);
dbot.say(data.channel, eval(q[1]));
}
};
return {
'onLoad': function() {
return commands;
}
};
};
exports.fetch = function(dbot) {
return js(dbot);
};