Fix for awaitMessages, Util

This commit is contained in:
Dragon Fire
2024-03-19 23:50:10 -04:00
parent cec26b124e
commit e93556e87b
6 changed files with 15 additions and 10 deletions
+4 -4
View File
@@ -2,9 +2,9 @@
const util = require('util');
/* eslint-disable no-unused-vars, prefer-destructuring */
const discord = require('discord.js');
const Util = require('../../util/Util');
/* eslint-enable no-unused-vars, prefer-destructuring */
const tags = require('common-tags');
const { escapeRegex, splitMessage } = require('../../util/Util');
const Command = require('../../framework/Command');
const nl = '!!NL!!';
@@ -90,14 +90,14 @@ module.exports = class EvalCommand extends Command {
const prepend = `\`\`\`javascript\n${prependPart}\n`;
const append = `\n${appendPart}\n\`\`\``;
if (input) {
return splitMessage(tags.stripIndents`
return Util.splitMessage(tags.stripIndents`
*Executed in ${hrDiff[0] > 0 ? `${hrDiff[0]}s ` : ''}${hrDiff[1] / 1000000}ms.*
\`\`\`javascript
${inspected}
\`\`\`
`, { maxLength: 1900, prepend, append });
} else {
return splitMessage(tags.stripIndents`
return Util.splitMessage(tags.stripIndents`
*Callback executed after ${hrDiff[0] > 0 ? `${hrDiff[0]}s ` : ''}${hrDiff[1] / 1000000}ms.*
\`\`\`javascript
${inspected}
@@ -109,7 +109,7 @@ module.exports = class EvalCommand extends Command {
get sensitivePattern() {
if (!this._sensitivePattern) {
let pattern = '';
if (this.client.token) pattern += escapeRegex(this.client.token);
if (this.client.token) pattern += Util.escapeRegex(this.client.token);
Object.defineProperty(this, '_sensitivePattern', { value: new RegExp(pattern, 'gi'), configurable: false });
}
return this._sensitivePattern;