Опять

This commit is contained in:
JonnyBro 2022-08-06 21:24:01 +05:00
parent 75e31dc6da
commit 9cc79f9066

View file

@ -45,19 +45,19 @@ class Loop extends BaseCommand {
.addOptions([ .addOptions([
{ {
label: client.translate("music/loop:AUTOPLAY"), label: client.translate("music/loop:AUTOPLAY"),
value: QueueRepeatMode.AUTOPLAY.toString() value: 3
}, },
{ {
label: client.translate("music/loop:QUEUE"), label: client.translate("music/loop:QUEUE"),
value: QueueRepeatMode.QUEUE.toString() value: 2
}, },
{ {
label: client.translate("music/loop:TRACK"), label: client.translate("music/loop:TRACK"),
value: QueueRepeatMode.TRACK.toString() value: 1
}, },
{ {
label: client.translate("music/loop:DISABLE"), label: client.translate("music/loop:DISABLE"),
value: QueueRepeatMode.OFF.toString() value: 0
} }
]) ])
); );
@ -75,11 +75,15 @@ class Loop extends BaseCommand {
}); });
collector.on("collect", async i => { collector.on("collect", async i => {
const type = QueueRepeatMode[i?.values[0]]; const type = i?.values[0];
queue.setRepeatMode(type); const mode = type === 3 ? QueueRepeatMode.AUTOPLAY :
type === 2 ? QueueRepeatMode.QUEUE :
type === 1 ? QueueRepeatMode.TRACK : QueueRepeatMode.OFF;
queue.setRepeatMode(mode);
return i.update({ return i.update({
content: interaction.translate(`music/loop:${type === QueueRepeatMode.AUTOPLAY ? "AUTOPLAY_ENABLED" : content: interaction.translate(`music/loop:${type === 3 ? "AUTOPLAY_ENABLED" :
type === QueueRepeatMode.QUEUE ? "QUEUE_ENABLED" : type === QueueRepeatMode.TRACK ? "TRACK_ENABLED" : "LOOP_DISABLED"}`), type === 2 ? "QUEUE_ENABLED" : type === 1 ? "TRACK_ENABLED" : "LOOP_DISABLED"}`),
components: [] components: []
}); });
}); });