2019-09-13 20:02:41 +00:00
|
|
|
const { clean } = require("../utils/misc.js");
|
|
|
|
|
|
|
|
exports.run = async (message, args) => {
|
2019-11-15 16:59:50 +00:00
|
|
|
if (message.author.id !== process.env.OWNER) return `${message.author.mention}, only the bot owner can use eval!`;
|
2019-09-13 20:02:41 +00:00
|
|
|
const code = args.join(" ");
|
|
|
|
try {
|
|
|
|
const evaled = eval(code);
|
|
|
|
const cleaned = await clean(evaled);
|
|
|
|
return `\`\`\`js\n${cleaned}\n\`\`\``;
|
|
|
|
} catch (err) {
|
|
|
|
return `\`ERROR\` \`\`\`xl\n${await clean(err)}\n\`\`\``;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.aliases = ["run"];
|