From 60d26c2b6ea647460d9509a00716be5dd442319c Mon Sep 17 00:00:00 2001 From: KeepingRunning <1599949878@qq.com> Date: Tue, 20 May 2025 03:57:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=81=BF=E5=85=8D=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/message_receive/storage.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/chat/message_receive/storage.py b/src/chat/message_receive/storage.py index d0041cd5..172341d1 100644 --- a/src/chat/message_receive/storage.py +++ b/src/chat/message_receive/storage.py @@ -84,12 +84,11 @@ class MessageStorage: logger.exception("存储撤回消息失败") @staticmethod - async def remove_recalled_message(time: str) -> None: + async def remove_recalled_message(timestamp: float) -> None: """删除撤回消息""" try: - # Assuming input 'time' is a string timestamp that can be converted to float - current_time_float = float(time) - RecalledMessages.delete().where(RecalledMessages.time < (current_time_float - 300)).execute() + # timestamp is the current time get from time.time() + RecalledMessages.delete().where(RecalledMessages.time < (timestamp - 300)).execute() except Exception: logger.exception("删除撤回消息失败")