How to handle Audio Receive Stream Pipeline on Connection Destroy (bot disconnected)
This is my code inside my receiver speaking on start event:
The problem is, I believe that 'rawAudio' is causing the following error when the connection is destroyed (bot is disconnected) and a user is speaking at the same time because the stream is not dealt with properly:
How can I resolve this and handle the rawAudio pipeline correctly?
3 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
@discordjs/voice v0.14.0
discord.js v14.7.1
I'll add that the error only appears when using
connection.destroy()
and does not occur when manually disconnecting the bot from the channel.
I'm wondering if this is an unintended bug and if I should report it instead 🤔
Just got this error again after a while so I'm gonna try and resurface this.Just remembered I opened an issue here: https://github.com/discordjs/discord.js/issues/8967
If anyone finds a solution though, that would be awesome!
GitHub
Connection.destroy() causes 'Premature Close' when pipeline is rece...
Which package is this bug report for? voice Issue description Have the bot join a voice channel and start voice receiving While speaking in the voice channel, run connection.destroy() to destroy th...