eximiabots-radiox/events/dispatcher/finish.js
2020-03-02 21:38:42 +02:00

20 lines
598 B
JavaScript

module.exports = async function (client, reason, guild) {
const radio = client.radio.get(guild.id);
radio.playing = false;
if (reason === "Stream is not generating quickly enough.") {
console.log("Song ended");
} else if (reason === "seek") {
return;
} else {
console.log(reason);
}
if (!radio.songLooping) {
if (radio.looping) {
radio.songs.push(radio.songs[0]);
}
radio.votes = 0;
radio.voters = [];
radio.songs.shift();
}
client.funcs.play(guild, radio.songs[0], client, 0, true);
};