fix(WebSocketShard): always reconnect on disconnected with 1000 (#8405)

This commit is contained in:
SpaceEEC
2022-08-01 13:24:25 +02:00
committed by GitHub
parent 3161e1a1ac
commit 359f688555

View File

@@ -462,15 +462,11 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
switch (code) {
case CloseCodes.Normal: {
this.debug([`Disconnected normally from code ${code}`]);
if (this.status === WebSocketShardStatus.Ready) {
return this.destroy({
code,
reason: 'Got disconnected by Discord',
recover: WebSocketShardDestroyRecovery.Reconnect,
});
}
break;
return this.destroy({
code,
reason: 'Got disconnected by Discord',
recover: WebSocketShardDestroyRecovery.Reconnect,
});
}
case CloseCodes.Resuming: {