mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
Ignore setSpeaking requests when VC isn't connected (#1638)
This commit is contained in:
parent
5ecd5f7d69
commit
62537b7deb
2 changed files with 3 additions and 0 deletions
|
|
@ -133,6 +133,7 @@ class VoiceConnection extends EventEmitter {
|
|||
*/
|
||||
setSpeaking(value) {
|
||||
if (this.speaking === value) return;
|
||||
if (this.status !== Constants.VoiceStatus.CONNECTED) return;
|
||||
this.speaking = value;
|
||||
this.sockets.ws.sendPacket({
|
||||
op: Constants.VoiceOPCodes.SPEAKING,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
const VolumeInterface = require('../util/VolumeInterface');
|
||||
const VoiceBroadcast = require('../VoiceBroadcast');
|
||||
const Constants = require('../../../util/Constants');
|
||||
|
||||
const secretbox = require('../util/Secretbox');
|
||||
|
||||
|
|
@ -108,6 +109,7 @@ class StreamDispatcher extends VolumeInterface {
|
|||
|
||||
setSpeaking(value) {
|
||||
if (this.speaking === value) return;
|
||||
if (this.player.voiceConnection.status !== Constants.VoiceStatus.CONNECTED) return;
|
||||
this.speaking = value;
|
||||
/**
|
||||
* Emitted when the dispatcher starts/stops speaking.
|
||||
|
|
|
|||
Loading…
Reference in a new issue