fix(WebSocketShard): Use correct import (#8357)

This commit is contained in:
Jiralite
2022-07-25 10:09:27 +01:00
committed by GitHub
parent 5a3c9996e0
commit 78d4295a40

View File

@@ -15,7 +15,7 @@ import {
GatewayReceivePayload, GatewayReceivePayload,
GatewaySendPayload, GatewaySendPayload,
} from 'discord-api-types/v10'; } from 'discord-api-types/v10';
import { CONNECTING, OPEN, RawData, WebSocket } from 'ws'; import { RawData, WebSocket } from 'ws';
import type { Inflate } from 'zlib-sync'; import type { Inflate } from 'zlib-sync';
import type { SessionInfo } from './WebSocketManager'; import type { SessionInfo } from './WebSocketManager';
import type { IContextFetchingStrategy } from '../strategies/context/IContextFetchingStrategy'; import type { IContextFetchingStrategy } from '../strategies/context/IContextFetchingStrategy';
@@ -182,7 +182,10 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
await this.strategy.updateSessionInfo(this.id, null); await this.strategy.updateSessionInfo(this.id, null);
} }
if (this.connection && (this.connection.readyState === OPEN || this.connection.readyState === CONNECTING)) { if (
this.connection &&
(this.connection.readyState === WebSocket.OPEN || this.connection.readyState === WebSocket.CONNECTING)
) {
this.connection.close(options.code, options.reason); this.connection.close(options.code, options.reason);
} }