1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 08:10:18 +00:00
musix-oss/events/dispatcherEvents/finish.js
2020-03-19 16:45:05 +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);
};