From 1f1c64284c21823dda673646f6995757cedda62c Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 16 Jul 2023 01:18:47 +0200 Subject: [PATCH] Formatting --- commands/filters.js | 8 +++++-- commands/pause.js | 53 +++++++++++++++++++-------------------------- commands/queue.js | 14 +++++++----- commands/remove.js | 4 +++- commands/skip.js | 8 +++++-- 5 files changed, 46 insertions(+), 41 deletions(-) diff --git a/commands/filters.js b/commands/filters.js index 19d310a..37229fa 100644 --- a/commands/filters.js +++ b/commands/filters.js @@ -129,7 +129,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setAuthor({ - name: interaction.member.nickname || interaction.user.username, + name: + interaction.member.nickname || + interaction.user.username, iconURL: interaction.user.avatarURL() }) .setDescription( @@ -148,7 +150,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setAuthor({ - name: interaction.member.nickname || interaction.user.username, + name: + interaction.member.nickname || + interaction.user.username, iconURL: interaction.user.avatarURL() }) .setDescription( diff --git a/commands/pause.js b/commands/pause.js index 76e17f6..b064e18 100644 --- a/commands/pause.js +++ b/commands/pause.js @@ -56,36 +56,27 @@ module.exports = { // change paused state to opposite of current state queue.node.setPaused(!queue.node.isPaused()); - if (queue.node.isPaused()) { - return await interaction.editReply({ - embeds: [ - new EmbedBuilder() - .setAuthor({ - name: interaction.member.nickname || interaction.user.username, - iconURL: interaction.user.avatarURL() - }) - .setDescription( - `**${embedIcons.pauseResumed} Paused track**\n**${durationFormat} [${queue.currentTrack.title}](${queue.currentTrack.url})**` - ) - .setThumbnail(queue.currentTrack.thumbnail) - .setColor(embedColors.colorSuccess) - ] - }); - } else { - return await interaction.editReply({ - embeds: [ - new EmbedBuilder() - .setAuthor({ - name: interaction.member.nickname || interaction.user.username, - iconURL: interaction.user.avatarURL() - }) - .setDescription( - `**${embedIcons.pauseResumed} Resumed track**\n**${durationFormat} [${queue.currentTrack.title}](${queue.currentTrack.url})**` - ) - .setThumbnail(queue.currentTrack.thumbnail) - .setColor(embedColors.colorSuccess) - ] - }); - } + return await interaction.editReply({ + embeds: [ + new EmbedBuilder() + .setAuthor({ + name: + interaction.member.nickname || + interaction.user.username, + iconURL: interaction.user.avatarURL() + }) + .setDescription( + `**${embedIcons.pauseResumed} ${ + queue.node.isPaused() + ? 'Paused Track' + : 'Resumed track' + }**\n**${durationFormat} [${ + queue.currentTrack.title + }](${queue.currentTrack.url})**` + ) + .setThumbnail(queue.currentTrack.thumbnail) + .setColor(embedColors.colorSuccess) + ] + }); } }; diff --git a/commands/queue.js b/commands/queue.js index 5c81d5c..3a3d2d7 100644 --- a/commands/queue.js +++ b/commands/queue.js @@ -41,7 +41,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setDescription( - `**${embedIcons.warning} Oops!**\nPage \`${pageIndex + 1}\` is not a valid page number.\n\nThe queue is currently empty, first add some tracks with \`/play\`!` + `**${embedIcons.warning} Oops!**\nPage \`${ + pageIndex + 1 + }\` is not a valid page number.\n\nThe queue is currently empty, first add some tracks with \`/play\`!` ) .setColor(embedColors.colorWarning) ] @@ -74,7 +76,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setDescription( - `**${embedIcons.warning} Oops!**\nPage \`${pageIndex + 1}\` is not a valid page number.\n\nThere are only a total of \`${totalPages}\` pages in the queue.` + `**${embedIcons.warning} Oops!**\nPage \`${ + pageIndex + 1 + }\` is not a valid page number.\n\nThere are only a total of \`${totalPages}\` pages in the queue.` ) .setColor(embedColors.colorWarning) ] @@ -92,9 +96,9 @@ module.exports = { ? '' : `\`${track.duration}\``; - return `**${pageIndex * 10 + index + 1}.** ${durationFormat} **[${ - track.title - }](${track.url})**`; + return `**${ + pageIndex * 10 + index + 1 + }.** ${durationFormat} **[${track.title}](${track.url})**`; }) .join('\n'); } diff --git a/commands/remove.js b/commands/remove.js index bfe792f..6a4d1e4 100644 --- a/commands/remove.js +++ b/commands/remove.js @@ -67,7 +67,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setAuthor({ - name: interaction.member.nickname || interaction.user.username, + name: + interaction.member.nickname || + interaction.user.username, iconURL: interaction.user.avatarURL() }) .setDescription( diff --git a/commands/skip.js b/commands/skip.js index d8371d9..fff30c1 100644 --- a/commands/skip.js +++ b/commands/skip.js @@ -67,7 +67,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setAuthor({ - name: interaction.member.nickname || interaction.user.username, + name: + interaction.member.nickname || + interaction.user.username, iconURL: interaction.user.avatarURL() }) .setDescription( @@ -103,7 +105,9 @@ module.exports = { embeds: [ new EmbedBuilder() .setAuthor({ - name: interaction.member.nickname || interaction.user.username, + name: + interaction.member.nickname || + interaction.user.username, iconURL: interaction.user.avatarURL() }) .setDescription(