From 043fe5c308203a93a61e0ff4d60357e698a6c418 Mon Sep 17 00:00:00 2001 From: ayntee Date: Sat, 13 Feb 2021 12:14:23 +0400 Subject: [PATCH] fix(ws/shard): use WebSocket#close() instead of WebSocket#send() to close connection (#518) * fix(ws/shard): use WebSocket#close() instead of WebSocket#send() to close connection * Oops forgot the return statement --- src/ws/shard.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ws/shard.ts b/src/ws/shard.ts index 3e3303e5f..955371662 100644 --- a/src/ws/shard.ts +++ b/src/ws/shard.ts @@ -228,7 +228,8 @@ async function heartbeat( }, }, ); - return shard.ws.send(JSON.stringify({ op: 4009 })); + + return shard.ws.close(4009, "Session timed out"); } }