Make Update Deps use reactions

This commit is contained in:
Dragon Fire
2024-04-27 00:00:50 -04:00
parent 9a8bbea10c
commit 6aecb32a93
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -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' }] });
}
+5 -1
View File
@@ -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')}