1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 02:00:20 +00:00

Update play.js

This commit is contained in:
MatteZ02 2020-02-06 22:06:40 +02:00
parent 3b931d4cae
commit 8647d8782f

View File

@ -18,7 +18,12 @@ module.exports = async function (guild, song, client, seek, play) {
dispatcher.on('start', () => {
dispatcher.player.streamingData.pausedTime = 0;
});
dispatcher.on('error', error => console.error(error));
dispatcher.on('error', error => {
console.error(error);
serverQueue.voiceChannel.leave();
client.queue.delete(guild.id);
return serverQueue.textChannel.send('<:redx:674263474704220182> An error has occured while playing music! The queue has been deleted.');
});
dispatcher.setVolume(serverQueue.volume / 10);
if (client.global.db.guilds[guild.id].startPlaying || play) {
const data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));