mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
voice: fix #2331 (speaking not set back to false on stream ending)
This commit is contained in:
@@ -62,6 +62,7 @@ class StreamDispatcher extends Writable {
|
|||||||
this.on('finish', () => {
|
this.on('finish', () => {
|
||||||
// Still emitting end for backwards compatibility, probably remove it in the future!
|
// Still emitting end for backwards compatibility, probably remove it in the future!
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
|
this._setSpeaking(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (typeof volume !== 'undefined') this.setVolume(volume);
|
if (typeof volume !== 'undefined') this.setVolume(volume);
|
||||||
@@ -251,9 +252,6 @@ class StreamDispatcher extends Writable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setSpeaking(value) {
|
_setSpeaking(value) {
|
||||||
if (this.speaking === value) return;
|
|
||||||
if (this.player.voiceConnection.status !== VoiceStatus.CONNECTED) return;
|
|
||||||
this.speaking = value;
|
|
||||||
this.player.voiceConnection.setSpeaking(value);
|
this.player.voiceConnection.setSpeaking(value);
|
||||||
/**
|
/**
|
||||||
* Emitted when the dispatcher starts/stops speaking.
|
* Emitted when the dispatcher starts/stops speaking.
|
||||||
|
|||||||
Reference in New Issue
Block a user