fix: update getDisplayRepeatMode showing wrong icon on success

This commit is contained in:
Marius Begby committed 2023-09-14 16:09:15 +02:00
1 parent cf45bde80b
commit ea8cf100f5
2 files changed
+5 -5

No files matched your search

+4 -4
View File
@@ -152,22 +152,22 @@ abstract class BaseInteraction {
return progressBar;
}
protected getDisplayRepeatMode(repeatMode: number): string {
protected getDisplayRepeatMode(repeatMode: number, state: string = 'info'): string {
let loopModeUserString: string;
let icon: string;
switch (repeatMode) {
case 1:
loopModeUserString = 'track';
icon = this.embedOptions.icons.loop;
icon = state === 'info' ? this.embedOptions.icons.loop : this.embedOptions.icons.looping;
break;
case 2:
loopModeUserString = 'queue';
icon = this.embedOptions.icons.loop;
icon = state === 'info' ? this.embedOptions.icons.loop : this.embedOptions.icons.looping;
break;
case 3:
loopModeUserString = 'autoplay';
icon = this.embedOptions.icons.autoplay;
icon = state === 'info' ? this.embedOptions.icons.autoplay : this.embedOptions.icons.autoplaying;
break;
default:
return '';
@@ -71,7 +71,7 @@ class NowplayingSkipButton extends BaseComponentInteraction {
.setDescription(
`**${this.embedOptions.icons.skipped} Skipped track**\n` +
`${this.getDisplayTrackDurationAndUrl(skippedTrack)}\n\n` +
`${this.getDisplayRepeatMode(queue.repeatMode)}`
`${this.getDisplayRepeatMode(queue.repeatMode, 'success')}`
)
.setThumbnail(skippedTrack.thumbnail)
.setColor(this.embedOptions.colors.success);