mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-30 15:30:07 +00:00
7 lines
209 B
TypeScript
7 lines
209 B
TypeScript
/** Use this function to close a ws connection properly */
|
|
export function closeWS(ws: WebSocket, code?: number, reason?: string) {
|
|
if (ws.readyState !== WebSocket.OPEN) return;
|
|
|
|
ws.close(code, reason);
|
|
}
|