1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 14:01:55 +00:00
musix-oss/events/dispatcher/finish.js
2020-03-14 18:38:02 +02:00

17 lines
450 B
JavaScript

module.exports = async function (client, reason, guild) {
const queue = client.queue.get(guild.id);
queue.playing = false;
if (reason === "seek") {
return;
}
if (!queue.songLooping) {
if (queue.looping) {
queue.songs.push(queue.songs[0]);
}
queue.votes = 0;
queue.voters = [];
queue.songs.shift();
}
client.funcs.play(guild, queue.songs[0], client, 0, true);
};