mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: Show total amount of tracks in queue footer besides pages
This commit is contained in:
1 parent
56065317e7
commit
3f15094cf8
1 file changed
+6
-4
@@ -44,13 +44,14 @@ module.exports = {
|
|||||||
.setDescription(`**${embedOptions.icons.queue} Tracks in queue**\n${queueString}`)
|
.setDescription(`**${embedOptions.icons.queue} Tracks in queue**\n${queueString}`)
|
||||||
.setColor(embedOptions.colors.info)
|
.setColor(embedOptions.colors.info)
|
||||||
.setFooter({
|
.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) {
|
if (pageIndex > totalPages - 1) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
@@ -99,6 +100,7 @@ module.exports = {
|
|||||||
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with **\`/loop\`**.\n\n`
|
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with **\`/loop\`**.\n\n`
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
|
|
||||||
if (!currentTrack) {
|
if (!currentTrack) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
@@ -111,7 +113,7 @@ module.exports = {
|
|||||||
`${repeatModeString}` + `**${embedOptions.icons.queue} Tracks in queue**\n${queueString}`
|
`${repeatModeString}` + `**${embedOptions.icons.queue} Tracks in queue**\n${queueString}`
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Page ${pageIndex + 1} of ${totalPages}`
|
text: `Page ${pageIndex + 1} of ${totalPages} (${queueLength} tracks)`
|
||||||
})
|
})
|
||||||
.setColor(embedOptions.colors.info)
|
.setColor(embedOptions.colors.info)
|
||||||
]
|
]
|
||||||
@@ -148,7 +150,7 @@ module.exports = {
|
|||||||
)
|
)
|
||||||
.setThumbnail(queue.currentTrack.thumbnail)
|
.setThumbnail(queue.currentTrack.thumbnail)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Page ${pageIndex + 1} of ${totalPages}`
|
text: `Page ${pageIndex + 1} of ${totalPages} (${queueLength} tracks)`
|
||||||
})
|
})
|
||||||
.setColor(embedOptions.colors.info)
|
.setColor(embedOptions.colors.info)
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in new issue
Block a user