From 3f15094cf88ace4ac1e054231cd4a6dfb3b9ddc8 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Tue, 18 Jul 2023 20:26:14 +0200 Subject: [PATCH] fix: Show total amount of tracks in queue footer besides pages --- src/commands/player/queue.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/commands/player/queue.js b/src/commands/player/queue.js index 82a0ddc8..f7fb7aa1 100644 --- a/src/commands/player/queue.js +++ b/src/commands/player/queue.js @@ -44,13 +44,14 @@ module.exports = { .setDescription(`**${embedOptions.icons.queue} Tracks in queue**\n${queueString}`) .setColor(embedOptions.colors.info) .setFooter({ - text: 'Page 1 of 1' + text: 'Page 1 of 1 (0 tracks)' }) ] }); } - const totalPages = Math.ceil(queue.tracks.data.length / 10) || 1; + const queueLength = queue.tracks.data.length; + const totalPages = Math.ceil(queueLength / 10) || 1; if (pageIndex > totalPages - 1) { return await interaction.editReply({ @@ -98,6 +99,7 @@ module.exports = { queue.repeatMode === 3 ? embedOptions.icons.autoplay : embedOptions.icons.loop } Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with **\`/loop\`**.\n\n` }`; + if (!currentTrack) { return await interaction.editReply({ @@ -111,7 +113,7 @@ module.exports = { `${repeatModeString}` + `**${embedOptions.icons.queue} Tracks in queue**\n${queueString}` ) .setFooter({ - text: `Page ${pageIndex + 1} of ${totalPages}` + text: `Page ${pageIndex + 1} of ${totalPages} (${queueLength} tracks)` }) .setColor(embedOptions.colors.info) ] @@ -148,7 +150,7 @@ module.exports = { ) .setThumbnail(queue.currentTrack.thumbnail) .setFooter({ - text: `Page ${pageIndex + 1} of ${totalPages}` + text: `Page ${pageIndex + 1} of ${totalPages} (${queueLength} tracks)` }) .setColor(embedOptions.colors.info) ]