fix: refactored nowplaying skip button component + more common methods

This commit is contained in:
Marius Begby committed 2023-09-13 23:33:40 +02:00
1 parent a9ce285650
commit 78e8f12c99
5 files changed
+78 -93

No files matched your search

-20
View File
@@ -124,26 +124,6 @@ class QueueCommand extends BaseSlashCommandInteraction {
return Promise.resolve();
}
private getDisplayRepeatMode(repeatMode: number): string {
const repeatModesFormatted = new Map([
[0, 'disabled'],
[1, 'track'],
[2, 'queue'],
[3, 'autoplay']
]);
if (repeatMode === 0) {
return '';
}
const loopModeUserString: string = repeatModesFormatted.get(repeatMode)!;
const icon = repeatMode === 3 ? this.embedOptions.icons.autoplay : this.embedOptions.icons.loop;
return (
`**${icon} Looping**\n` +
`Loop mode is set to **\`${loopModeUserString}\`**. You can change it with **\`/loop\`**.\n\n`
);
}
private getPageIndex(interaction: ChatInputCommandInteraction): number {
return (interaction.options.getNumber('page') || 1) - 1;
}