Fix eval on large outputs

This commit is contained in:
Essem 2023-03-14 18:12:29 -05:00
parent d236179639
commit 3272429cf6
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -17,9 +17,11 @@ class EvalCommand extends Command {
const sendString = `\`\`\`js\n${cleaned}\n\`\`\``; const sendString = `\`\`\`js\n${cleaned}\n\`\`\``;
if (sendString.length >= 2000) { if (sendString.length >= 2000) {
return { return {
text: "The result was too large, so here it is as a file:", content: "The result was too large, so here it is as a file:",
file: cleaned, files: [{
contents: cleaned,
name: "result.txt" name: "result.txt"
}]
}; };
} else { } else {
return sendString; return sendString;