mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 22:16:13 +00:00
fix: Better handling and formatting of duration
This commit is contained in:
1 parent
b8bd552335
commit
ebe4f7419a
1 file changed
+15
-3
+15
-3
@@ -68,9 +68,14 @@ module.exports = {
|
||||
queueString = queue.tracks.data
|
||||
.slice(page * 10, page * 10 + 10)
|
||||
.map((track, index) => {
|
||||
return `**${page * 10 + index + 1}.** \`[${
|
||||
track.duration
|
||||
}]\` [${track.title}](${track.url})`;
|
||||
let durationFormat =
|
||||
track.raw.duration === 0 || track.duration === '0:00'
|
||||
? ''
|
||||
: `\`[${track.duration}]\``;
|
||||
|
||||
return `**${page * 10 + index + 1}.** ${durationFormat} [${
|
||||
track.title
|
||||
}](${track.url})`;
|
||||
})
|
||||
.join('\n');
|
||||
}
|
||||
@@ -98,6 +103,13 @@ module.exports = {
|
||||
length: 13
|
||||
});
|
||||
|
||||
if (
|
||||
currentTrack.raw.duration === 0 ||
|
||||
currentTrack.duration === '0:00'
|
||||
) {
|
||||
bar = 'No duration available.';
|
||||
}
|
||||
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
|
||||
Reference in new issue
Block a user