mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 14:44:58 +05:00
queue и song для loop
This commit is contained in:
parent
bad3f64161
commit
8f28541c50
1 changed files with 9 additions and 1 deletions
|
@ -18,12 +18,20 @@ class Loop extends Command {
|
||||||
|
|
||||||
async run(message, args) {
|
async run(message, args) {
|
||||||
const voice = message.member.voice.channel;
|
const voice = message.member.voice.channel;
|
||||||
|
const type = args[0];
|
||||||
const queue = this.client.player.getQueue(message);
|
const queue = this.client.player.getQueue(message);
|
||||||
|
|
||||||
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");
|
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");
|
||||||
if (!queue) return message.error("music/play:NOT_PLAYING");
|
if (!queue) return message.error("music/play:NOT_PLAYING");
|
||||||
|
|
||||||
const mode = this.client.player.setRepeatMode(message);
|
let mode = null;
|
||||||
|
if (type === "queue") {
|
||||||
|
mode = this.client.player.setRepeatMode(message, 2);
|
||||||
|
} else if (type === "song") {
|
||||||
|
mode = this.client.player.setRepeatMode(message, 1);
|
||||||
|
} else {
|
||||||
|
mode = this.client.player.setRepeatMode(message, 0);
|
||||||
|
};
|
||||||
|
|
||||||
message.success(`music/loop:${mode ? mode === 2 ? "QUEUE" : "SONG" : "DISABLED"}`)
|
message.success(`music/loop:${mode ? mode === 2 ? "QUEUE" : "SONG" : "DISABLED"}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue