cardboardbox/commands/System/eval.js
2019-11-26 16:22:59 -05:00

24 lines
624 B
JavaScript

exports.run = async (client, message, args, level) => { // eslint-disable-line no-unused-vars
const code = args.join(" ");
try {
const evaled = eval(code);
const clean = await client.clean(client, evaled);
message.channel.send(`\`\`\`js\n${clean}\n\`\`\``);
} catch (err) {
message.channel.send(`\`ERROR\` \`\`\`xl\n${await client.clean(client, err)}\n\`\`\``);
}
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Bot Owner"
};
exports.help = {
name: "eval",
category: "System",
description: "Evaluates arbitrary javascript.",
usage: "eval [...code]"
};