discord-player: player stucks randomly on queue.
Since last week, player stucks randomly on any queue index. skipping the track doesn’t seems to work. After a track ends, the player doesn’t continue to the next track on the queue, instead it stops playing audio and stays on the voice channel with no audio. I think it might be a bug on the queue system (?)
player.events.on("playerStart", async (queue, track) => {
if (guildHandler.get(queue.guild)) {
// last change here
try {
if (guildHandler.get(queue.guild).commandName === 'play' && !queue.tracks.data.length) {
await guildHandler.get(queue.guild).followUp({embeds : [Embed.musicPlaying(track)]});
}
else {
await guildHandler.get(queue.guild).channel.send({embeds : [Embed.musicPlaying(track)]});
}
// guildHandler.set(queue.guild, newInteraction);
}
catch (error) {
console.log(error);
return void console.log("Error on playerStart : " + error);
}
finally {
console.log("playerStart initiated");
}
}
});
playerInitiated? but the message doesn’t seem to be sent on discord. And error doesn’t seem to be caught.
Anyways I’m new to discord-player. Sorry for any misunderstanding.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16
After some investigations, turns out that it was the youtube library being unstable. I used ytdl-core and when I switched to discord-player-youtubei it became a lot more stable. Thank you for the help
🙂 if this is the case, then the streaming library you are using failed to stream the content. Streaming it via ffmpeg seems to work for you, you can keep it like that.
skipFFmpegmode is turned on by default to avoid instantiating ffmpeg when alternative way of streaming exists, which saves a lot of resources.your code is prone to race conditions, please follow this pattern.