diff --git a/commands/eval.js b/commands/eval.js index c556b30..33bd93d 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -9,11 +9,12 @@ exports.run = async (message, args) => { const sendString = `\`\`\`js\n${cleaned}\n\`\`\``; if (sendString.length >= 2000) { return message.channel.createMessage("The result was too large, so here it is as a file:", [{ - file: evaled, + file: cleaned, name: "result.txt" }]); + } else { + return sendString; } - return sendString; } catch (err) { return `\`ERROR\` \`\`\`xl\n${await clean(err)}\n\`\`\``; } diff --git a/commands/exec.js b/commands/exec.js index 64b7fd3..906e047 100644 --- a/commands/exec.js +++ b/commands/exec.js @@ -9,7 +9,15 @@ exports.run = async (message, args) => { const execed = await exec(code); if (execed.stderr) return `\`ERROR\` \`\`\`xl\n${await clean(execed.stderr)}\n\`\`\``; const cleaned = await clean(execed.stdout); - return `\`\`\`bash\n${cleaned}\n\`\`\``; + const sendString = `\`\`\`bash\n${cleaned}\n\`\`\``; + if (sendString.length >= 2000) { + return message.channel.createMessage("The result was too large, so here it is as a file:", [{ + file: cleaned, + name: "result.txt" + }]); + } else { + return sendString; + } } catch (err) { return `\`ERROR\` \`\`\`xl\n${await clean(err)}\n\`\`\``; }