Local splitmessage

This commit is contained in:
Dragon Fire
2024-03-19 23:17:50 -04:00
parent 5ff9136441
commit 429d7b2e10
2 changed files with 32 additions and 3 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
const util = require('util');
const discord = require('discord.js');
const tags = require('common-tags');
const { escapeRegex } = require('../../util/Util');
const { escapeRegex, splitMessage } = require('../../util/Util');
const Command = require('../../framework/Command');
const nl = '!!NL!!';
@@ -88,14 +88,14 @@ module.exports = class EvalCommand extends Command {
const prepend = `\`\`\`javascript\n${prependPart}\n`;
const append = `\n${appendPart}\n\`\`\``;
if (input) {
return discord.splitMessage(tags.stripIndents`
return splitMessage(tags.stripIndents`
*Executed in ${hrDiff[0] > 0 ? `${hrDiff[0]}s ` : ''}${hrDiff[1] / 1000000}ms.*
\`\`\`javascript
${inspected}
\`\`\`
`, { maxLength: 1900, prepend, append });
} else {
return discord.splitMessage(tags.stripIndents`
return splitMessage(tags.stripIndents`
*Callback executed after ${hrDiff[0] > 0 ? `${hrDiff[0]}s ` : ''}${hrDiff[1] / 1000000}ms.*
\`\`\`javascript
${inspected}