From 6aecb32a937c533572322221335dbcae103c39fd Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 27 Apr 2024 00:00:50 -0400 Subject: [PATCH] Make Update Deps use reactions --- commands/edit-image/sketch.js | 2 +- commands/util/dependency-update.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/edit-image/sketch.js b/commands/edit-image/sketch.js index 5863c43b..5060a413 100644 --- a/commands/edit-image/sketch.js +++ b/commands/edit-image/sketch.js @@ -44,7 +44,7 @@ module.exports = class SketchCommand extends Command { magik.out('0x20+120'); magik.setFormat('png'); const attachment = await magikToBuffer(magik); - reactIfAble(msg, msg.author, SUCCESS_EMOJI_ID, '✅'); + await reactIfAble(msg, msg.author, SUCCESS_EMOJI_ID, '✅'); if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.'); return msg.say({ files: [{ attachment, name: 'sketch.png' }] }); } diff --git a/commands/util/dependency-update.js b/commands/util/dependency-update.js index beb30168..99430511 100644 --- a/commands/util/dependency-update.js +++ b/commands/util/dependency-update.js @@ -2,13 +2,15 @@ const Command = require('../../framework/Command'); const request = require('node-superfetch'); const semver = require('semver'); const { stripIndents } = require('common-tags'); +const { reactIfAble } = require('../../util/Util'); const { dependencies, devDependencies, optionalDependencies } = require('../../package'); +const { LOADING_EMOJI_ID, SUCCESS_EMOJI_ID } = process.env; module.exports = class DependencyUpdateCommand extends Command { constructor(client) { super(client, { name: 'dependency-update', - aliases: ['dep-update', 'dependencies-update', 'npm-update', 'deps'], + aliases: ['dep-update', 'dependencies-update', 'npm-update', 'deps', 'update-deps'], group: 'util', memberName: 'dependency-update', description: 'Checks for dependency updates.', @@ -26,6 +28,7 @@ module.exports = class DependencyUpdateCommand extends Command { } async run(msg) { + await reactIfAble(msg, msg.author, LOADING_EMOJI_ID, '💬'); const needUpdate = []; for (const [dep, ver] of Object.entries(dependencies)) { const update = await this.parseUpdate(dep, ver); @@ -47,6 +50,7 @@ module.exports = class DependencyUpdateCommand extends Command { const breaking = pkg.breaking ? ' ⚠️' : ''; return `${pkg.name} (${pkg.oldVer} -> ${pkg.newVer})${breaking}`; }); + await reactIfAble(msg, msg.author, SUCCESS_EMOJI_ID, '✅'); return msg.say(stripIndents` __**Package Updates Available:**__ ${updatesList.join('\n')}