From 1d986257dc20c448805fe700856b8e936b59210b Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 7 May 2025 11:33:58 +0800 Subject: [PATCH] fix --- plugins.v2/wechatforward/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins.v2/wechatforward/__init__.py b/plugins.v2/wechatforward/__init__.py index 819fb21..de01b0f 100644 --- a/plugins.v2/wechatforward/__init__.py +++ b/plugins.v2/wechatforward/__init__.py @@ -694,12 +694,14 @@ class WeChatForward(_PluginBase): # 搜索消息,获取消息text中的用户 result = re.search(r"用户:(.*?)\n", text) if not result: - # 订阅消息,获取消息text中的用户 - pattern = r"来自用户:(.*?)$" - result = re.search(pattern, text) + result = re.search(r"\*用户\*:(.*?)\n", text) if not result: - logger.error(f"{title} 未获取到用户,跳过处理") - continue + # 订阅消息,获取消息text中的用户 + pattern = r"来自用户:(.*?)$" + result = re.search(pattern, text) + if not result: + logger.error(f"{title} 未获取到用户,跳过处理") + continue # 获取消息text中的用户 user_id = result.group(1)