From b1798c9dad9ff6fdcb133cc94a0617346f4481e9 Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Thu, 6 Feb 2025 12:30:26 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=E6=B6=88=E6=81=AF=E9=87=8D=E5=8F=91bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/handle/helloHandle.py | 2 +- core/handle/textHandle.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/handle/helloHandle.py b/core/handle/helloHandle.py index 016766a0..1cd46987 100644 --- a/core/handle/helloHandle.py +++ b/core/handle/helloHandle.py @@ -4,5 +4,5 @@ import logging logger = logging.getLogger(__name__) -async def handleHelloMessage(conn, text): +async def handleHelloMessage(conn): await conn.websocket.send(json.dumps(conn.welcome_msg)) diff --git a/core/handle/textHandle.py b/core/handle/textHandle.py index 27890bcc..3cb933c6 100644 --- a/core/handle/textHandle.py +++ b/core/handle/textHandle.py @@ -13,7 +13,7 @@ async def handleTextMessage(conn, message): try: msg_json = json.loads(message) if msg_json["type"] == "hello": - await handleHelloMessage(conn, "你好") + await handleHelloMessage(conn) elif msg_json["type"] == "abort": await handleAbortMessage(conn) elif msg_json["type"] == "listen": @@ -33,5 +33,4 @@ async def handleTextMessage(conn, message): if "text" in msg_json: await startToChat(conn, msg_json["text"]) except json.JSONDecodeError: - await handleTextMessage(conn, message) - await conn.websocket.send(message) + await conn.websocket.send(message) \ No newline at end of file