From df43f9eb9d9f1b9db756efa9dbbba67779a4bf33 Mon Sep 17 00:00:00 2001 From: Essem Date: Fri, 22 Jul 2022 20:03:36 -0500 Subject: [PATCH] Added more node name fallbacks, move slash command acknowledge to beginning of image command --- classes/imageCommand.js | 6 ++++-- commands/fun/ancient.js | 2 +- commands/fun/cat.js | 2 +- commands/general/donate.js | 2 +- commands/music/nowplaying.js | 2 +- utils/soundplayer.js | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/classes/imageCommand.js b/classes/imageCommand.js index 9191e23..bfa2f48 100644 --- a/classes/imageCommand.js +++ b/classes/imageCommand.js @@ -52,6 +52,10 @@ class ImageCommand extends Command { params: {} }; + if (this.type === "application") { + await this.acknowledge(); + } + if (this.constructor.requiresImage) { try { const image = await imageDetect(this.client, this.message, this.interaction, this.options, true); @@ -95,8 +99,6 @@ class ImageCommand extends Command { let status; if (magickParams.params.type === "image/gif" && this.type === "classic") { status = await this.processMessage(this.message); - } else { - await this.acknowledge(); } try { diff --git a/commands/fun/ancient.js b/commands/fun/ancient.js index 224507a..2ad0f4e 100644 --- a/commands/fun/ancient.js +++ b/commands/fun/ancient.js @@ -4,7 +4,7 @@ import Command from "../../classes/command.js"; class AncientCommand extends Command { async run() { await this.acknowledge(); - const controller = new AbortController(); // eslint-disable-line no-undef + const controller = new AbortController(); const timeout = setTimeout(() => { controller.abort(); }, 15000); diff --git a/commands/fun/cat.js b/commands/fun/cat.js index 4ad1734..51d124a 100644 --- a/commands/fun/cat.js +++ b/commands/fun/cat.js @@ -4,7 +4,7 @@ import Command from "../../classes/command.js"; class CatCommand extends Command { async run() { await this.acknowledge(); - const controller = new AbortController(); // eslint-disable-line no-undef + const controller = new AbortController(); const timeout = setTimeout(() => { controller.abort(); }, 15000); diff --git a/commands/general/donate.js b/commands/general/donate.js index 2b6e74b..bf2e556 100644 --- a/commands/general/donate.js +++ b/commands/general/donate.js @@ -5,7 +5,7 @@ class DonateCommand extends Command { async run() { await this.acknowledge(); let prefix = ""; - const controller = new AbortController(); // eslint-disable-line no-undef + const controller = new AbortController(); const timeout = setTimeout(() => { controller.abort(); }, 5000); diff --git a/commands/music/nowplaying.js b/commands/music/nowplaying.js index caa0b05..671e8cc 100644 --- a/commands/music/nowplaying.js +++ b/commands/music/nowplaying.js @@ -31,7 +31,7 @@ class NowPlayingCommand extends MusicCommand { }, { name: "🌐 Node:", - value: player.node.name + value: player.node ? player.node.name : "Unknown" }, { name: `${"▬".repeat(parts)}🔘${"▬".repeat(10 - parts)}`, diff --git a/utils/soundplayer.js b/utils/soundplayer.js index 52f87d2..3c9aa94 100644 --- a/utils/soundplayer.js +++ b/utils/soundplayer.js @@ -147,7 +147,7 @@ export async function nextSong(client, options, connection, track, info, music, }, { name: "🌐 Node:", - value: connection.node.name + value: connection.node ? connection.node.name : "Unknown" }, { name: `${"▬".repeat(parts)}🔘${"▬".repeat(10 - parts)}`,