1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-16 18:56:00 +00:00

Updated looping

This commit is contained in:
MatteZ02
2019-10-12 12:49:24 +03:00
parent 8c117edd1e
commit 970ec44de8
5 changed files with 5 additions and 9 deletions

View File

@ -35,9 +35,6 @@ module.exports = async function (video, message, voiceChannel, client, playlist
}
} else {
serverQueue.songs.push(song);
if (serverQueue.looping) {
client.secondaryQueue.push(song);
}
if (playlist) return undefined;
return message.channel.send(`:white_check_mark: **${song.title}** has been added to the queue!`);
}

View File

@ -17,10 +17,10 @@ module.exports = async function (guild, song, client, message, seek) {
} else {
console.log(reason);
}
serverQueue.songs.shift();
if (serverQueue.looping && serverQueue.songs.length === 0) {
serverQueue.songs = [...client.secondaryQueue];
if (serverQueue.looping) {
serverQueue.songs.push(serverQueue.songs[0]);
}
serverQueue.songs.shift();
client.funcs.play(guild, serverQueue.songs[0], client, message);
});
dispatcher.setVolume(serverQueue.volume / 10);