mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-10 03:55:29 +01:00
Merge pull request #373 from codetheweb/bugfix/only-add-listeners-once
This commit is contained in:
commit
7b2401ff19
|
@ -452,14 +452,18 @@ export default class {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.voiceConnection.listeners(VoiceConnectionStatus.Disconnected).length === 0) {
|
||||
this.voiceConnection.on(VoiceConnectionStatus.Disconnected, this.onVoiceConnectionDisconnect.bind(this));
|
||||
}
|
||||
|
||||
if (!this.audioPlayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.audioPlayer.listeners('stateChange').length === 0) {
|
||||
this.audioPlayer.on('stateChange', this.onAudioPlayerStateChange.bind(this));
|
||||
}
|
||||
}
|
||||
|
||||
private onVoiceConnectionDisconnect(): void {
|
||||
this.disconnect();
|
||||
|
|
Loading…
Reference in a new issue