From 8838a0424400c32bf0599ff2b807f33c81d35bcf Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 7 Jun 2020 18:29:11 -0400 Subject: [PATCH] Fix lint --- .../util-owner/command-leaderboard-export.js | 2 +- commands/util-owner/generate-commands.js | 2 +- commands/util-owner/generate-credit.js | 2 +- commands/util-owner/generate-process-env.js | 3 +-- commands/util-owner/shutdown.js | 17 +++++++++++------ 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/commands/util-owner/command-leaderboard-export.js b/commands/util-owner/command-leaderboard-export.js index 9349afbd..97af70ba 100644 --- a/commands/util-owner/command-leaderboard-export.js +++ b/commands/util-owner/command-leaderboard-export.js @@ -25,6 +25,6 @@ module.exports = class CommandLeaderboardExportCommand extends Command { async run(msg) { const result = this.client.exportCommandLeaderboard(); await msg.direct({ files: [{ attachment: result, name: 'command-leaderboard.json' }] }); - return msg.say('📬 Sent \`command-leaderboard.json\` to your DMs!'); + 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 85b880e4..c06831e8 100644 --- a/commands/util-owner/generate-commands.js +++ b/commands/util-owner/generate-commands.js @@ -25,6 +25,6 @@ module.exports = class GenerateCommandsCommand extends Command { }); const text = `Total: ${this.client.registry.commands.size}\n${list.join('\n')}`; await msg.direct({ files: [{ attachment: Buffer.from(text), name: 'commands.txt' }] }); - return msg.say('📬 Sent \`commands.txt\` to your DMs!'); + 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 a1b4e10c..91e1772f 100644 --- a/commands/util-owner/generate-credit.js +++ b/commands/util-owner/generate-credit.js @@ -48,6 +48,6 @@ module.exports = class GenerateCreditCommand extends Command { return ` * ${cmd.name} (${embedURL(cmd.reason, cmd.reasonURL || '', false)})`; }).join('\n')}`); await msg.direct({ files: [{ attachment: Buffer.from(mapped.join('\n')), name: 'credit.txt' }] }); - return msg.say('📬 Sent \`credit.txt\` to your DMs!'); + 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 62a6e083..e1db2bf3 100644 --- a/commands/util-owner/generate-process-env.js +++ b/commands/util-owner/generate-process-env.js @@ -1,7 +1,6 @@ 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) { @@ -26,6 +25,6 @@ module.exports = class GenerateProcessEnvCommand extends Command { return `${line}="${process.env[line] || ''}"`; }).join('\n'); await msg.direct({ files: [{ attachment: Buffer.from(list), name: 'process.env.txt' }] }); - return msg.say('📬 Sent \`process.env.txt\` to your DMs!'); + 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 0568c1c6..87624974 100644 --- a/commands/util-owner/shutdown.js +++ b/commands/util-owner/shutdown.js @@ -23,11 +23,16 @@ module.exports = class ShutdownCommand extends Command { } 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; + try { + this.uses++; + this.client.exportCommandLeaderboard(); + this.client.logger.info('[SHUTDOWN] Manual shutdown engaged.'); + await msg.say('Shutting down... :('); + process.exit(code); + return null; + } catch { + process.exit(code); + return null; + } } };