diff --git a/commands/util-owner/command-leaderboard-export.js b/commands/util-owner/command-leaderboard-export.js index 34791d3d..9349afbd 100644 --- a/commands/util-owner/command-leaderboard-export.js +++ b/commands/util-owner/command-leaderboard-export.js @@ -22,8 +22,9 @@ module.exports = class CommandLeaderboardExportCommand extends Command { }); } - run(msg) { + async run(msg) { const result = this.client.exportCommandLeaderboard(); - return msg.say({ files: [{ attachment: result, name: 'command-leaderboard.json' }] }); + await msg.direct({ files: [{ attachment: result, name: 'command-leaderboard.json' }] }); + return msg.say('📬 Sent \`command-leaderboard.json\` to your DMs!'); } }; diff --git a/commands/util-owner/generate-commands.js b/commands/util-owner/generate-commands.js index bc3e4829..85b880e4 100644 --- a/commands/util-owner/generate-commands.js +++ b/commands/util-owner/generate-commands.js @@ -14,7 +14,7 @@ module.exports = class GenerateCommandsCommand extends Command { }); } - run(msg) { + async run(msg) { const list = this.client.registry.groups .map(g => { const commands = g.commands.filter(c => !c.hidden); @@ -24,6 +24,7 @@ module.exports = class GenerateCommandsCommand extends Command { }).join('\n')}`; }); const text = `Total: ${this.client.registry.commands.size}\n${list.join('\n')}`; - return msg.say({ files: [{ attachment: Buffer.from(text), name: 'commands.txt' }] }); + await msg.direct({ files: [{ attachment: Buffer.from(text), name: 'commands.txt' }] }); + return msg.say('📬 Sent \`commands.txt\` to your DMs!'); } }; diff --git a/commands/util-owner/generate-credit.js b/commands/util-owner/generate-credit.js index e86dc3d7..a1b4e10c 100644 --- a/commands/util-owner/generate-credit.js +++ b/commands/util-owner/generate-credit.js @@ -15,7 +15,7 @@ module.exports = class GenerateCreditCommand extends Command { }); } - run(msg) { + async run(msg) { let credit = []; for (const command of this.client.registry.commands.values()) { if (!command.credit || command.credit.length <= 1) continue; @@ -47,6 +47,7 @@ module.exports = class GenerateCreditCommand extends Command { if (!cmd.reasonURL) return ` * ${cmd.name} (${cmd.reason})`; return ` * ${cmd.name} (${embedURL(cmd.reason, cmd.reasonURL || '', false)})`; }).join('\n')}`); - return msg.say({ files: [{ attachment: Buffer.from(mapped.join('\n')), name: 'credit.txt' }] }); + await msg.direct({ files: [{ attachment: Buffer.from(mapped.join('\n')), name: 'credit.txt' }] }); + return msg.say('📬 Sent \`credit.txt\` to your DMs!'); } }; diff --git a/commands/util-owner/generate-process-env.js b/commands/util-owner/generate-process-env.js index b8be4433..62a6e083 100644 --- a/commands/util-owner/generate-process-env.js +++ b/commands/util-owner/generate-process-env.js @@ -1,6 +1,7 @@ const Command = require('../../structures/Command'); const fs = require('fs'); const path = require('path'); +const { verify } = require('../../util/Util'); module.exports = class GenerateProcessEnvCommand extends Command { constructor(client) { @@ -16,7 +17,7 @@ module.exports = class GenerateProcessEnvCommand extends Command { }); } - run(msg) { + async run(msg) { const data = fs.readFileSync(path.join(__dirname, '..', '..', '.env.example'), { encoding: 'utf8' }); const list = data.split('\n').map(line => { if (!line) return ''; @@ -24,6 +25,7 @@ module.exports = class GenerateProcessEnvCommand extends Command { line = line.replace('=', ''); return `${line}="${process.env[line] || ''}"`; }).join('\n'); - return msg.say({ files: [{ attachment: Buffer.from(list), name: 'process.env.txt' }] }); + await msg.direct({ files: [{ attachment: Buffer.from(list), name: 'process.env.txt' }] }); + return msg.say('📬 Sent \`process.env.txt\` to your DMs!'); } }; diff --git a/commands/util-owner/shutdown.js b/commands/util-owner/shutdown.js index 15be548b..0568c1c6 100644 --- a/commands/util-owner/shutdown.js +++ b/commands/util-owner/shutdown.js @@ -22,10 +22,11 @@ module.exports = class ShutdownCommand extends Command { }); } - run(msg, { code }) { + async run(msg, { code }) { this.uses++; this.client.exportCommandLeaderboard(); this.client.logger.info('[SHUTDOWN] Manual shutdown engaged.'); + await msg.say('Shutting down... :('); process.exit(code); return null; } diff --git a/package.json b/package.json index c8bf62fa..23c1c578 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "116.3.0", + "version": "116.3.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {