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
@@ -152,6 +152,26 @@ abstract class BaseInteraction {
return progressBar;
}
protected 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`
);
}
abstract execute(
params: BaseInteractionParams
): Promise<Message<boolean> | ApplicationCommandOptionChoiceData | void>;