From f87d35e635c8d26c0b3886ae561915289f968007 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Wed, 12 Jul 2023 21:01:07 +0200 Subject: [PATCH] fix: updated duration format in messages --- commands/play.js | 2 +- commands/skip.js | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/commands/play.js b/commands/play.js index 3761b97..0cf949c 100644 --- a/commands/play.js +++ b/commands/play.js @@ -105,7 +105,7 @@ module.exports = { let durationFormat = track.raw.duration === 0 || track.duration === '0:00' ? '' - : `\`[${track.duration}]\``; + : `\`${track.duration}\``; if (searchResult.playlist && searchResult.tracks.length > 1) { return await interaction.editReply({ diff --git a/commands/skip.js b/commands/skip.js index befc28f..e338099 100644 --- a/commands/skip.js +++ b/commands/skip.js @@ -57,6 +57,11 @@ module.exports = { }); } else { const skippedTrack = queue.currentTrack; + let durationFormat = + skippedTrack.raw.duration === 0 || + skippedTrack.duration === '0:00' + ? '' + : `\`${skippedTrack.duration}\``; queue.node.skipTo(skipToTrack - 1); return await interaction.editReply({ @@ -67,7 +72,7 @@ module.exports = { iconURL: interaction.user.avatarURL() }) .setDescription( - `**Skipped**\n**[${skippedTrack.title}](${skippedTrack.url})**.` + `**Skipped track**\n${durationFormat} **[${skippedTrack.title}](${skippedTrack.url})**.` ) .setThumbnail(skippedTrack.thumbnail) .setColor(embedColors.colorSuccess) @@ -88,6 +93,11 @@ module.exports = { } const skippedTrack = queue.currentTrack; + let durationFormat = + skippedTrack.raw.duration === 0 || + skippedTrack.duration === '0:00' + ? '' + : `\`${skippedTrack.duration}\``; queue.node.skip(); return await interaction.editReply({ @@ -98,7 +108,7 @@ module.exports = { iconURL: interaction.user.avatarURL() }) .setDescription( - `**Skipped**\n**[${skippedTrack.title}](${skippedTrack.url})**.` + `**Skipped track**\n${durationFormat} **[${skippedTrack.title}](${skippedTrack.url})**.` ) .setThumbnail(skippedTrack.thumbnail) .setColor(embedColors.colorSuccess)