mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-04-19 21:03:56 +02:00
Merge pull request #373 from codetheweb/bugfix/only-add-listeners-once
This commit is contained in:
commit
7b2401ff19
1 changed files with 6 additions and 2 deletions
|
@ -452,14 +452,18 @@ export default class {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.voiceConnection.listeners(VoiceConnectionStatus.Disconnected).length === 0) {
|
||||||
this.voiceConnection.on(VoiceConnectionStatus.Disconnected, this.onVoiceConnectionDisconnect.bind(this));
|
this.voiceConnection.on(VoiceConnectionStatus.Disconnected, this.onVoiceConnectionDisconnect.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.audioPlayer) {
|
if (!this.audioPlayer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.audioPlayer.listeners('stateChange').length === 0) {
|
||||||
this.audioPlayer.on('stateChange', this.onAudioPlayerStateChange.bind(this));
|
this.audioPlayer.on('stateChange', this.onAudioPlayerStateChange.bind(this));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private onVoiceConnectionDisconnect(): void {
|
private onVoiceConnectionDisconnect(): void {
|
||||||
this.disconnect();
|
this.disconnect();
|
||||||
|
|
Loading…
Add table
Reference in a new issue