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(" ");
try {
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 sendString = `\`\`\`bash\n${cleaned}\n\`\`\``;
if (sendString.length >= 2000) {

View File

@ -5,7 +5,7 @@ import { paths } from "../../utils/collections.js";
class ReloadCommand extends Command {
async run() {
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(" ");
if (!commandName || !commandName.trim()) return "You need to provide a command to reload!";
await this.acknowledge();