From fcd620283fc571b23d2e95b17f879b9cde5963ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 13 Aug 2024 00:48:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E8=BE=B9=E7=95=8C?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/onebot/network/active-websocket.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onebot/network/active-websocket.ts b/src/onebot/network/active-websocket.ts index 1133d7c1..7e483532 100644 --- a/src/onebot/network/active-websocket.ts +++ b/src/onebot/network/active-websocket.ts @@ -26,7 +26,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter { } onEvent(event: T) { - if (this.connection) { + if (this.connection && this.connection.readyState === WebSocket.OPEN) { this.connection.send(JSON.stringify(event)); } }