From 8584c6c6fdad872227b18c006ff82716d2ae5394 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 4 Oct 2023 12:36:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ---- connect.py | 12 +++--------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index d85c83b..b4a3b79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ /venv config.toml - -# Added by cargo - -/target diff --git a/connect.py b/connect.py index 35582b2..9f46361 100644 --- a/connect.py +++ b/connect.py @@ -189,9 +189,7 @@ async def add_message(data: Dict[str, Any]): evals: str = data.get('message').get('content')[2:] result = await safe_eval(evals) - reply = ReplyMessage(id=data['message']['_id'], - username=sender_name, - content=content) + reply = ReplyMessage(id=data['message']['_id']) message = Message(content=result, reply_to=reply, room_id=room_id) @@ -202,9 +200,7 @@ async def add_message(data: Dict[str, Any]): randomer = random.Random(f'{sender_id}-{data["message"]["date"]}-jrrp') result = randomer.randint(0, 50) + randomer.randint(0, 50) print(f'{sender_name} 今日人品值为 {result}') - reply = ReplyMessage(id=data['message']['_id'], - username=sender_name, - content='jrrp') + reply = ReplyMessage(id=data['message']['_id']) message = Message(content=f'{sender_name} 今日人品值为 {result}', reply_to=reply, room_id=room_id) @@ -212,9 +208,7 @@ async def add_message(data: Dict[str, Any]): await sio.emit('sendMessage', message.to_json()) # 如果只包括一个或多个 6 # elif data['message']['content'].replace(' ', '') in ('6', '666', '六', '3+3', '5+1', '4+2', '2+4', '1+5'): - # reply = ReplyMessage(id=data['message']['_id'], - # username=sender_name, - # content=content) + # reply = ReplyMessage(id=data['message']['_id']) # message = Message(content='你 6 nm 呢', # reply_to=reply, # room_id=room_id)