test
This commit is contained in:
		@@ -3,7 +3,8 @@ const vm = require('vm');
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
module.exports = (lib) => {
 | 
					module.exports = (lib) => {
 | 
				
			||||||
  const sandbox = {
 | 
					  const sandbox = {
 | 
				
			||||||
    bot: lib.bot
 | 
					    bot: lib.bot,
 | 
				
			||||||
 | 
					    output: "nothing"
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  lib.trigger.add({
 | 
					  lib.trigger.add({
 | 
				
			||||||
@@ -13,10 +14,13 @@ module.exports = (lib) => {
 | 
				
			|||||||
    active: 1,
 | 
					    active: 1,
 | 
				
			||||||
    func: (e) => {
 | 
					    func: (e) => {
 | 
				
			||||||
      var args = e.message.trim().match(/^!bot (.*?)/i)[1];
 | 
					      var args = e.message.trim().match(/^!bot (.*?)/i)[1];
 | 
				
			||||||
 | 
					      e.reply(args);
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
      const script = new vm.Script(args);
 | 
					      const script = new vm.Script(args);
 | 
				
			||||||
      const context = new vm.createContext(sandbox);
 | 
					      const context = new vm.createContext(sandbox);
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
      script.runInContext(context);
 | 
					      script.runInContext(context);
 | 
				
			||||||
      e.reply(util.inspect(sandbox));
 | 
					      e.reply(util.inspect(sandbox.output));
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    desc: 'bot debug'
 | 
					    desc: 'bot debug'
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user