@@ -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) => {
 | 
					module.exports = (lib) => {
 | 
				
			||||||
  lib.trigger.add({
 | 
					  lib.trigger.add({
 | 
				
			||||||
    name: 'test',
 | 
					    name: 'test',
 | 
				
			||||||
    call: /^!test (.*)/i,
 | 
					    call: /^!test$/i,
 | 
				
			||||||
    level: 100,
 | 
					    level: 0,
 | 
				
			||||||
    active: 1,
 | 
					    active: 0,
 | 
				
			||||||
    func: (e) => {
 | 
					    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'
 | 
					    desc: 'muh'
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user