From 16f0c05099373d1b4425a344f03516fb16ef52ad Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Sat, 10 Dec 2022 13:52:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dsession=5Fid=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/qqbot/core.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/cores/qqbot/core.py b/cores/qqbot/core.py index df6e5f435..6152a6584 100644 --- a/cores/qqbot/core.py +++ b/cores/qqbot/core.py @@ -23,16 +23,13 @@ class botClient(botpy.Client): qq_msg = result.group(1).strip() # 检测用户id,返回对应缓存的prompt - session_id_pattern = r"<@!\d+>" - session_id_result = re.search(session_id_pattern, message.content) - if session_id_result: - # 匹配出sessionid - session_id = session_id_result.group(0) - + # session_id_pattern = r"<@!\d+>" + # session_id_result = re.search(session_id_pattern, message.content) + session_id = message.author.id + if session_id: if qq_msg == "/reset": - session_id = session_id_result.group(0) session_dict[session_id] = [] - await message.reply(content=f"{message.member.nick} 的历史记录重置成功") + await message.reply(content=f"{message.member.nick}(id: {session_id}) 的历史记录重置成功") return if qq_msg[:4] == "/his":