router, api and stuff
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { admins, getLevel } from "../admin";
|
||||
import { admins } from "../admin";
|
||||
import vm from "vm";
|
||||
|
||||
const maxoutput = 1000;
|
||||
@ -19,15 +19,14 @@ export default bot => bot._trigger.set("sandbox_debug", new bot.trigger({
|
||||
context.admins = admins;
|
||||
context.e = e;
|
||||
context.bot = bot;
|
||||
context.level = getLevel;
|
||||
let output = vm.runInContext(args, vm.createContext(context));
|
||||
if (typeof output !== undefined && output) {
|
||||
output = JSON.stringify(output);
|
||||
if (output.length > maxoutput)
|
||||
return e.reply(`holy fuck, Ausgabe wäre viel zu lang! (${output.length} Zeichen :DDDDDD)`);
|
||||
else
|
||||
return e.reply(output);
|
||||
return r.reply(output.length > maxoutput ? `holy fuck, Ausgabe wäre viel zu lang! (${output.length} Zeichen :DDDDDD)` : output);
|
||||
}
|
||||
else
|
||||
e.reply("false lol");
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
e.reply(err.message);
|
||||
|
Reference in New Issue
Block a user