parent
6209c98c1e
commit
9e69dd4e33
@ -1,23 +1,11 @@
|
||||
var Sandbox = require("sandbox");
|
||||
var s = new Sandbox({
|
||||
timeout: 2000
|
||||
});
|
||||
let sbhead = "\"use strict\";";
|
||||
sbhead += Object.getOwnPropertyNames(Math).map(function(v){return "const " + v + "=Math." + v + ";" + (typeof Math[v] == "function" ? v + ".bind(Math);" : "")}).join("");
|
||||
|
||||
module.exports = (lib) => {
|
||||
lib.trigger.add({
|
||||
name: 'test',
|
||||
call: /^!test (.*)/i,
|
||||
level: 100,
|
||||
active: 1,
|
||||
call: /^!test$/i,
|
||||
level: 0,
|
||||
active: 0,
|
||||
func: (e) => {
|
||||
var args = e.message.trim().match(/^!test (.*)/i)[1];
|
||||
s.run(sbhead + args, (out) => {
|
||||
let con = out.console.length > 0 ? " and printed to console: " + out.console : "";
|
||||
let text = (out.result + con).replace(/[\r\n\t]/g, " ");
|
||||
e.reply(e.user.getNick() + " it returned: " + (text.length > 400 ? "f0ck you" : text));
|
||||
});
|
||||
|
||||
},
|
||||
desc: 'muh'
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user