fix: refactored pause command, added common method getDisplayTrackDurationAndUrl()

This commit is contained in:
Marius Begby committed 2023-09-12 19:28:08 +02:00
1 parent ee8cc06e4d
commit 0850d9b26d
7 files changed
+64 -94

No files matched your search

+1 -10
View File
@@ -62,16 +62,7 @@ class QueueCommand extends BaseSlashCommandInteraction {
queueString = queue.tracks.data
.slice(pageIndex * 10, pageIndex * 10 + 10)
.map((track, index) => {
let durationFormat =
Number(track.raw.duration) === 0 || track.duration === '0:00' ? '' : `\`${track.duration}\``;
if (track.raw.live) {
durationFormat = `${this.embedOptions.icons.liveTrack} \`LIVE\``;
}
return `**${pageIndex * 10 + index + 1}.** **${durationFormat} [${track.title}](${
track.raw.url ?? track.url
})**`;
return `**${pageIndex * 10 + index + 1}.** ${this.getDisplayTrackDurationAndUrl(track)}`;
})
.join('\n');
}