From e4b6c2397f65f959038d42b80f528fb52aee72fa Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Fri, 15 Mar 2024 20:10:31 +0100 Subject: [PATCH] move method to bottom --- src/interactions/slashcommands/queue.ts | 78 ++++++++++++------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/interactions/slashcommands/queue.ts b/src/interactions/slashcommands/queue.ts index e0ea9c0..cdbd906 100644 --- a/src/interactions/slashcommands/queue.ts +++ b/src/interactions/slashcommands/queue.ts @@ -64,45 +64,6 @@ class QueueCommand extends BaseSlashCommandInteraction { return await this.handleNoCurrentTrack(logger, interaction, queue, queueTracksListString, translator); } - private createEmbedActionRow( - currentTrack: Track, - queue: GuildQueue, - translator: Translator - ): APIActionRowComponent { - const embedActionRow: APIActionRowComponent = { - type: ComponentType.ActionRow, - components: [] - }; - - const previousButton = createNewActionButton( - `action-previous-button_${currentTrack.id}`, - this.embedOptions.icons.previousTrack, - embedActionRow - ); - - const playPauseButton = createNewActionButton( - `action-pauseresume-button_${currentTrack.id}`, - this.embedOptions.icons.pauseResumeTrack, - embedActionRow - ); - - const skipButton = createNewActionButton( - `action-skip-button_${currentTrack.id}`, - this.embedOptions.icons.nextTrack, - embedActionRow - ); - - if (this.embedOptions.components.showButtonLabels) { - previousButton.label = translator('musicPlayerCommon.controls.previous'); - playPauseButton.label = queue.node.isPaused() - ? translator('musicPlayerCommon.controls.resume') - : translator('musicPlayerCommon.controls.pause'); - skipButton.label = translator('musicPlayerCommon.controls.skip'); - } - - return embedActionRow; - } - private async handleCurrentTrack( logger: Logger, interaction: ChatInputCommandInteraction, @@ -264,6 +225,45 @@ class QueueCommand extends BaseSlashCommandInteraction { return fullFooterData; } + + private createEmbedActionRow( + currentTrack: Track, + queue: GuildQueue, + translator: Translator + ): APIActionRowComponent { + const embedActionRow: APIActionRowComponent = { + type: ComponentType.ActionRow, + components: [] + }; + + const previousButton = createNewActionButton( + `action-previous-button_${currentTrack.id}`, + this.embedOptions.icons.previousTrack, + embedActionRow + ); + + const playPauseButton = createNewActionButton( + `action-pauseresume-button_${currentTrack.id}`, + this.embedOptions.icons.pauseResumeTrack, + embedActionRow + ); + + const skipButton = createNewActionButton( + `action-skip-button_${currentTrack.id}`, + this.embedOptions.icons.nextTrack, + embedActionRow + ); + + if (this.embedOptions.components.showButtonLabels) { + previousButton.label = translator('musicPlayerCommon.controls.previous'); + playPauseButton.label = queue.node.isPaused() + ? translator('musicPlayerCommon.controls.resume') + : translator('musicPlayerCommon.controls.pause'); + skipButton.label = translator('musicPlayerCommon.controls.skip'); + } + + return embedActionRow; + } } export default new QueueCommand();