Closed p0thi closed 3 years ago
Hi there,
We're working on a new implementation of Discord's Voice API that has better playback quality and is more reliable than what we currently support in Discord.js v12 - check it out at https://github.com/discordjs/voice!
The new library solves many of the issues that users are facing, and as part of this, we're dropping built-in support for voice in our next major release. We have a PR (https://github.com/discordjs/discord.js/pull/5402) that adds native support for our new voice library - once this PR is merged, this issue will be closed.
You can still use our new voice library before that PR lands - just take a look at our music bot example to see how to get started upgrading your voice code. By using the boilerplate music player in the example, you can make it even easier to upgrade your code.
Note that the PR above only reduces some of the boilerplate code you'd otherwise have to write - you do not have to wait for the PR to be merged to start using the new voice library.
If you have any questions about this, feel free to:
#djs-new-voice
, specifically for this!) to ask general questions about the library, give feedback on the library, and get support with upgrading to it
Please describe the problem you are having in as much detail as possible: I have a sound bot, that joins a channel, plays an audio file and leaves the channel again. If the user asks the bot to join this channel too soon after it disconnected, the bot joins the channel, but the channel.join() in the code rejects with a
VOICE_CONNECTION_TIMEOUT
Error after 15 sec . Then it is impossible to either join or leave the channel again. but technically the bot joined the channel and is still in there.The sequence of triggering sound commands has to be really fast to reproduce this issue. Even some delays <300 ms are enough on my setup to let this work like expected.
Include a reproducible code sample here, if possible:
I noticed, that issuing multiple
channel.join()
commands after the crashes in a catch block, make the bot leave the channel after sending the file stream. But in this case the audio in discord is not hearable. I just lets the bot disconnect from the channel after the finish event. After that everything is back to normal.Here is another code sample of the same function of my workarounds that worked for me so far, but seem a bit hacky since it uses a static delay.
Further details: