Merge branch 'master' into remove

This commit is contained in:
Max Isom 2021-11-20 19:02:48 -05:00
commit b93e6644b7
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880

View file

@ -443,14 +443,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();