From 359f6885558fcfb3151971ab589077a89ee71a01 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Mon, 1 Aug 2022 13:24:25 +0200 Subject: [PATCH] fix(WebSocketShard): always reconnect on disconnected with 1000 (#8405) --- packages/ws/src/ws/WebSocketShard.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/ws/src/ws/WebSocketShard.ts b/packages/ws/src/ws/WebSocketShard.ts index 7440e553f..7ed486c3e 100644 --- a/packages/ws/src/ws/WebSocketShard.ts +++ b/packages/ws/src/ws/WebSocketShard.ts @@ -462,15 +462,11 @@ export class WebSocketShard extends AsyncEventEmitter { 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: {