From 080e957655b54ef75c6a118c7c467e6152ec6a59 Mon Sep 17 00:00:00 2001 From: murm Date: Fri, 17 Mar 2023 01:47:51 -0400 Subject: [PATCH] updated exec to support html formatting --- commands/general/exec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/general/exec.js b/commands/general/exec.js index d1744e7..31eb960 100644 --- a/commands/general/exec.js +++ b/commands/general/exec.js @@ -15,17 +15,17 @@ class ExecCommand extends Command { const code = this.options.cmd ?? this.args.join(" "); try { const execed = await exec(code); - if (execed.stderr) return `${await clean(execed.stderr)}`; + if (execed.stderr) return { html: `
${await clean(execed.stderr)}
` }; const cleaned = await clean(execed.stdout); const sendString = `${cleaned}`; - if (sendString.length >= 2000) { + if (sendString.length >= 4000) { return { text: "The result was too large, so here it is as a file:", file: cleaned, name: "result.txt" }; } else { - return sendString; + return { html: "
"+sendString+"
" }; } } catch (err) { return `\`ERROR\` ${await clean(err)}`;