diff --git a/commands/Bot Owner/eval.js b/commands/Bot Owner/eval.js index 2df9ee8..9750277 100644 --- a/commands/Bot Owner/eval.js +++ b/commands/Bot Owner/eval.js @@ -4,27 +4,29 @@ class Eval extends Command { constructor(client) { super(client, { name: "eval", - description: "Evaluates arbitrary JavaScript.", + description: "Evaluates JavaScript code.", category: "Bot Owner", - usage: "eval ", + usage: "eval ", permLevel: "Bot Owner" }); } async run(message, args) { + // log the usage this.client.logger.warn("⚠️ | Eval command used"); - + // code to eval const code = args.join(" "); try { const evaled = eval(code); const clean = await this.client.clean(this.client, evaled); const MAX_CHARS = 3 + 2 + clean.length + 3; + // Messages can't be over 2000 chars. if (MAX_CHARS > 2000) { return message.channel.send("☑️ | Output exceeded 2000 characters, sending as a file.", { files: [{ attachment: Buffer.from(clean), name: "output.txt" }] }); } message.channel.send(`\`\`\`js\n${clean}\n\`\`\``); } catch (err) { - message.channel.send(`\`ERROR\` \`\`\`xl\n${await this.client.clean(this.client, err)}\n\`\`\``); + message.channel.send(`\`Error\` \`\`\`xl\n${await this.client.clean(this.client, err)}\n\`\`\``); } } }