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) { switch (code) {
case CloseCodes.Normal: { case CloseCodes.Normal: {
this.debug([`Disconnected normally from code ${code}`]); this.debug([`Disconnected normally from code ${code}`]);
if (this.status === WebSocketShardStatus.Ready) { return this.destroy({
return this.destroy({ code,
code, reason: 'Got disconnected by Discord',
reason: 'Got disconnected by Discord', recover: WebSocketShardDestroyRecovery.Reconnect,
recover: WebSocketShardDestroyRecovery.Reconnect, });
});
}
break;
} }
case CloseCodes.Resuming: { case CloseCodes.Resuming: {