mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
fix(WebSocketShard): account code 1000 with no prior indication (#8399)
This commit is contained in:
@@ -460,8 +460,20 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
|
|||||||
|
|
||||||
private async onClose(code: number) {
|
private async onClose(code: number) {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case 1000:
|
case CloseCodes.Normal: {
|
||||||
case 4200: {
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
case CloseCodes.Resuming: {
|
||||||
this.debug([`Disconnected normally from code ${code}`]);
|
this.debug([`Disconnected normally from code ${code}`]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user