Clean up failed voice connections
This commit is contained in:
1 parent
d10dae1b53
commit
b29fda5ae9
2 files changed
+12
-5
No files matched your search
@@ -89,7 +89,14 @@ export default class AudioManager {
|
||||
});
|
||||
this.connection.subscribe(this.audioPlayer);
|
||||
|
||||
await entersState(this.connection, VoiceConnectionStatus.Ready, this.options.connectTimeoutMs);
|
||||
try {
|
||||
await entersState(this.connection, VoiceConnectionStatus.Ready, this.options.connectTimeoutMs);
|
||||
} catch (error) {
|
||||
this.connection.destroy();
|
||||
this.connection = undefined;
|
||||
this.playbackState = 'stopped';
|
||||
throw error;
|
||||
}
|
||||
this.playbackState = 'ready';
|
||||
this.scheduleRenewal();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user