mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: change map to switch statement
This commit is contained in:
1 parent
2d08a9aa85
commit
7018b690bb
1 file changed
+17
-10
+17
-10
@@ -153,19 +153,26 @@ abstract class BaseInteraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected getDisplayRepeatMode(repeatMode: number): string {
|
protected getDisplayRepeatMode(repeatMode: number): string {
|
||||||
const repeatModesFormatted = new Map([
|
let loopModeUserString: string;
|
||||||
[0, 'disabled'],
|
let icon: string;
|
||||||
[1, 'track'],
|
|
||||||
[2, 'queue'],
|
|
||||||
[3, 'autoplay']
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (repeatMode === 0) {
|
switch (repeatMode) {
|
||||||
return '';
|
case 1:
|
||||||
|
loopModeUserString = 'track';
|
||||||
|
icon = this.embedOptions.icons.loop;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
loopModeUserString = 'queue';
|
||||||
|
icon = this.embedOptions.icons.loop;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
loopModeUserString = 'autoplay';
|
||||||
|
icon = this.embedOptions.icons.autoplay;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const loopModeUserString: string = repeatModesFormatted.get(repeatMode)!;
|
|
||||||
const icon = repeatMode === 3 ? this.embedOptions.icons.autoplay : this.embedOptions.icons.loop;
|
|
||||||
return (
|
return (
|
||||||
`**${icon} Looping**\n` +
|
`**${icon} Looping**\n` +
|
||||||
`Loop mode is set to **\`${loopModeUserString}\`**. You can change it with **\`/loop\`**.\n\n`
|
`Loop mode is set to **\`${loopModeUserString}\`**. You can change it with **\`/loop\`**.\n\n`
|
||||||
|
|||||||
Reference in new issue
Block a user