From 77c91a350f4c5b1336c7917a24ac9e9b3fc4ad66 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Mon, 10 Jul 2023 00:29:01 +0200 Subject: [PATCH] fix: trying to read title on track for initialized but empty queue --- commands/skip.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/commands/skip.js b/commands/skip.js index 57bf0cc..7526f30 100644 --- a/commands/skip.js +++ b/commands/skip.js @@ -75,6 +75,18 @@ module.exports = { }); } } else { + if (queue.tracks.data.length === 0 && !queue.currentTrack) { + return await interaction.editReply({ + embeds: [ + new EmbedBuilder() + .setDescription( + `**Failed**\nThere are no tracks in the queue and nothing currently playing.` + ) + .setColor(embedColors.colorWarning) + ] + }); + } + const skippedTrack = queue.currentTrack; queue.node.skip();