From 9cc79f906604c3f89deecd24a0c24f16fa4bb319 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sat, 6 Aug 2022 21:24:01 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BF=D1=8F=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Music/loop.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/commands/Music/loop.js b/commands/Music/loop.js index cf590864..bc8c8d16 100644 --- a/commands/Music/loop.js +++ b/commands/Music/loop.js @@ -45,19 +45,19 @@ class Loop extends BaseCommand { .addOptions([ { label: client.translate("music/loop:AUTOPLAY"), - value: QueueRepeatMode.AUTOPLAY.toString() + value: 3 }, { label: client.translate("music/loop:QUEUE"), - value: QueueRepeatMode.QUEUE.toString() + value: 2 }, { label: client.translate("music/loop:TRACK"), - value: QueueRepeatMode.TRACK.toString() + value: 1 }, { 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 => { - const type = QueueRepeatMode[i?.values[0]]; - queue.setRepeatMode(type); + const type = i?.values[0]; + const mode = type === 3 ? QueueRepeatMode.AUTOPLAY : + type === 2 ? QueueRepeatMode.QUEUE : + type === 1 ? QueueRepeatMode.TRACK : QueueRepeatMode.OFF; + + queue.setRepeatMode(mode); return i.update({ - content: interaction.translate(`music/loop:${type === QueueRepeatMode.AUTOPLAY ? "AUTOPLAY_ENABLED" : - type === QueueRepeatMode.QUEUE ? "QUEUE_ENABLED" : type === QueueRepeatMode.TRACK ? "TRACK_ENABLED" : "LOOP_DISABLED"}`), + content: interaction.translate(`music/loop:${type === 3 ? "AUTOPLAY_ENABLED" : + type === 2 ? "QUEUE_ENABLED" : type === 1 ? "TRACK_ENABLED" : "LOOP_DISABLED"}`), components: [] }); });