fix: Better handling and formatting of duration

This commit is contained in:
Marius Begby committed 2023-07-10 21:08:39 +02:00
1 parent b8bd552335
commit ebe4f7419a
1 file changed
+15 -3
+15 -3
View File
@@ -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()