move method to bottom

This commit is contained in:
Marius Begby committed 2024-03-15 20:10:31 +01:00
1 parent f6667e0c87
commit e4b6c2397f
1 file changed
+39 -39
+39 -39
View File
@@ -64,45 +64,6 @@ class QueueCommand extends BaseSlashCommandInteraction {
return await this.handleNoCurrentTrack(logger, interaction, queue, queueTracksListString, translator); return await this.handleNoCurrentTrack(logger, interaction, queue, queueTracksListString, translator);
} }
private createEmbedActionRow(
currentTrack: Track,
queue: GuildQueue,
translator: Translator
): APIActionRowComponent<APIMessageActionRowComponent> {
const embedActionRow: APIActionRowComponent<APIMessageActionRowComponent> = {
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( private async handleCurrentTrack(
logger: Logger, logger: Logger,
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction,
@@ -264,6 +225,45 @@ class QueueCommand extends BaseSlashCommandInteraction {
return fullFooterData; return fullFooterData;
} }
private createEmbedActionRow(
currentTrack: Track,
queue: GuildQueue,
translator: Translator
): APIActionRowComponent<APIMessageActionRowComponent> {
const embedActionRow: APIActionRowComponent<APIMessageActionRowComponent> = {
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(); export default new QueueCommand();