mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
Ignore setSpeaking requests when VC isn't connected (#1638)
This commit is contained in:
@@ -132,6 +132,7 @@ class VoiceConnection extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
setSpeaking(value) {
|
setSpeaking(value) {
|
||||||
if (this.speaking === value) return;
|
if (this.speaking === value) return;
|
||||||
|
if (this.status !== Constants.VoiceStatus.CONNECTED) return;
|
||||||
this.speaking = value;
|
this.speaking = value;
|
||||||
this.sockets.ws.sendPacket({
|
this.sockets.ws.sendPacket({
|
||||||
op: Constants.VoiceOPCodes.SPEAKING,
|
op: Constants.VoiceOPCodes.SPEAKING,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const VolumeInterface = require('../util/VolumeInterface');
|
const VolumeInterface = require('../util/VolumeInterface');
|
||||||
const VoiceBroadcast = require('../VoiceBroadcast');
|
const VoiceBroadcast = require('../VoiceBroadcast');
|
||||||
|
const Constants = require('../../../util/Constants');
|
||||||
|
|
||||||
const secretbox = require('../util/Secretbox');
|
const secretbox = require('../util/Secretbox');
|
||||||
|
|
||||||
@@ -108,6 +109,7 @@ class StreamDispatcher extends VolumeInterface {
|
|||||||
|
|
||||||
setSpeaking(value) {
|
setSpeaking(value) {
|
||||||
if (this.speaking === value) return;
|
if (this.speaking === value) return;
|
||||||
|
if (this.player.voiceConnection.status !== Constants.VoiceStatus.CONNECTED) return;
|
||||||
this.speaking = value;
|
this.speaking = value;
|
||||||
/**
|
/**
|
||||||
* Emitted when the dispatcher starts/stops speaking.
|
* Emitted when the dispatcher starts/stops speaking.
|
||||||
|
|||||||
Reference in New Issue
Block a user