const util = require('util'); const vm = require('vm'); module.exports = (lib) => { var sandbox = { bot: lib.bot, output: undefined, e: null }; lib.trigger.add({ name: 'bot debug', call: /^\!bot (.*)/i, level: 100, active: 1, func: (e) => { var args = e.message.match(/^\!bot (.*)/i)[1]; sandbox.e = e; vm.runInNewContext('this.output = '+args, sandbox); var output = util.inspect(sandbox.output); if(typeof(output) !== undefined) e.reply(output); }, desc: 'bot debug' }); };