mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 22:15:37 +00:00
fix: refactored pause command, added common method getDisplayTrackDurationAndUrl()
This commit is contained in:
1 parent
ee8cc06e4d
commit
0850d9b26d
7 files changed
+64
-94
No files matched your search
@@ -52,14 +52,6 @@ class RemoveCommand extends BaseSlashCommandInteraction {
|
||||
// Remove specified track number from queue
|
||||
const removedTrack: Track = queue.node.remove(removeTrackNumber - 1)!;
|
||||
logger.debug(`Removed track '${removedTrack.url}' from queue.`);
|
||||
let durationFormat =
|
||||
Number(removedTrack.raw.duration) === 0 || removedTrack.duration === '0:00'
|
||||
? ''
|
||||
: `\`${removedTrack.duration}\``;
|
||||
|
||||
if (removedTrack.raw.live) {
|
||||
durationFormat = `${this.embedOptions.icons.liveTrack} \`LIVE\``;
|
||||
}
|
||||
|
||||
logger.debug('Responding with success embed.');
|
||||
return await interaction.editReply({
|
||||
@@ -67,9 +59,9 @@ class RemoveCommand extends BaseSlashCommandInteraction {
|
||||
new EmbedBuilder()
|
||||
.setAuthor(await this.getEmbedUserAuthor(interaction))
|
||||
.setDescription(
|
||||
`**${this.embedOptions.icons.success} Removed track**\n**${durationFormat} [${
|
||||
removedTrack.title
|
||||
}](${removedTrack.raw.url ?? removedTrack.url})**`
|
||||
`**${this.embedOptions.icons.success} Removed track**\n${this.getDisplayTrackDurationAndUrl(
|
||||
removedTrack
|
||||
)}`
|
||||
)
|
||||
.setThumbnail(removedTrack.thumbnail)
|
||||
.setColor(this.embedOptions.colors.success)
|
||||
|
||||
Reference in new issue
Block a user