discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.36k stars 3.97k forks source link

Guild.voice.speaking is null when the bot is dispatching audio #4273

Closed Protected closed 3 years ago

Protected commented 4 years ago

This is a fairly straightforward issue, I think. Guild.voice is a VoiceState, which contains a 'speaking' getter which should be true when the associated user is known to be speaking. But the bot doesn't seem to acknowledge it is, itself, speaking when the SDK should know that it is, beyond a shadow of a doubt.

Looking into it, VoiceState.speaking checks VoiceConnection._speaking, which isn't updated for the bot proper, even if I explicitly use setSpeaking on the connection.

Further details:

amishshah commented 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: