fix reload and formatting on exec

This commit is contained in:
murm 2023-03-15 10:46:45 -04:00
parent d6cb0e3c78
commit a350cfbdc6
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ class ExecCommand extends Command {
const code = this.options.cmd ?? this.args.join(" "); const code = this.options.cmd ?? this.args.join(" ");
try { try {
const execed = await exec(code); const execed = await exec(code);
if (execed.stderr) return `\`\`\`xl\n${await clean(execed.stderr)}\n\`\`\``; if (execed.stderr) return `\`\`\`\n${await clean(execed.stderr)}\n\`\`\``;
const cleaned = await clean(execed.stdout); const cleaned = await clean(execed.stdout);
const sendString = `\`\`\`bash\n${cleaned}\n\`\`\``; const sendString = `\`\`\`bash\n${cleaned}\n\`\`\``;
if (sendString.length >= 2000) { if (sendString.length >= 2000) {

View file

@ -5,7 +5,7 @@ import { paths } from "../../utils/collections.js";
class ReloadCommand extends Command { class ReloadCommand extends Command {
async run() { async run() {
const owners = process.env.OWNER.split(","); const owners = process.env.OWNER.split(",");
if (!owners.includes(this.sender)) return "Only the bot owner can reload commands!"; if (!owners.includes(this.author)) return "Only the bot owner can reload commands!";
const commandName = this.options.cmd ?? this.args.join(" "); const commandName = this.options.cmd ?? this.args.join(" ");
if (!commandName || !commandName.trim()) return "You need to provide a command to reload!"; if (!commandName || !commandName.trim()) return "You need to provide a command to reload!";
await this.acknowledge(); await this.acknowledge();