From d75ea0e014f9b9aa65cf71ba8492d4a1790cad9c Mon Sep 17 00:00:00 2001 From: gaojiangxia <1551959560@qq.com> Date: Tue, 21 Nov 2023 15:03:07 +0800 Subject: [PATCH] a --- chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chat.py b/chat.py index 006a259..086bc16 100644 --- a/chat.py +++ b/chat.py @@ -53,7 +53,7 @@ async def echo(websocket): h = 0; r = {'type':'history_num','content':str(h)} message = json.dumps(r,ensure_ascii=False) - await websocket.send(message) + websockets.broadcast(users[room_id], message) #历史记录 if "history" in event["type"]: start = int(event['page']) @@ -66,7 +66,7 @@ async def echo(websocket): h = [] r = {'type':'history','content':h} message = json.dumps(r,ensure_ascii=False) - await websocket.send(message) + websockets.broadcast(users[room_id], message) #聊天 if "chat" in event['type']: chat = { -- Gitee