f0ckv1/src/trigger/bot.js

21 lines
503 B
JavaScript
Raw Normal View History

2016-10-29 05:59:05 +02:00
var safeEval = require('safe-eval');
2016-10-29 05:16:37 +02:00
module.exports = (lib) => {
lib.trigger.add({
name: 'bot debug',
2016-10-29 05:35:11 +02:00
call: /^\!bot (.*)/i,
2016-10-29 05:16:37 +02:00
level: 100,
active: 1,
func: (e) => {
2016-10-29 05:35:11 +02:00
var args = e.message.match(/^\!bot (.*)/i)[1];
2016-10-29 05:59:05 +02:00
var context = {
bot: lib.bot,
e: e
}
2016-10-29 06:00:37 +02:00
var output = safeEval(args, context);
2016-10-29 06:01:28 +02:00
if(typeof(output) != undefined && output !== 'undefined' && output)
2016-10-29 06:00:37 +02:00
e.reply(output);
2016-10-29 05:16:37 +02:00
},
desc: 'bot debug'
});
};