mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 21:57:14 +08:00
fix: at_list bug in wechat channel
This commit is contained in:
@@ -109,9 +109,10 @@ class ChatChannel(Channel):
|
|||||||
flag = True
|
flag = True
|
||||||
pattern = f"@{re.escape(self.name)}(\u2005|\u0020)"
|
pattern = f"@{re.escape(self.name)}(\u2005|\u0020)"
|
||||||
subtract_res = re.sub(pattern, r"", content)
|
subtract_res = re.sub(pattern, r"", content)
|
||||||
for at in context["msg"].at_list:
|
if isinstance(context["msg"].at_list, list):
|
||||||
pattern = f"@{re.escape(at)}(\u2005|\u0020)"
|
for at in context["msg"].at_list:
|
||||||
subtract_res = re.sub(pattern, r"", subtract_res)
|
pattern = f"@{re.escape(at)}(\u2005|\u0020)"
|
||||||
|
subtract_res = re.sub(pattern, r"", subtract_res)
|
||||||
if subtract_res == content and context["msg"].self_display_name:
|
if subtract_res == content and context["msg"].self_display_name:
|
||||||
# 前缀移除后没有变化,使用群昵称再次移除
|
# 前缀移除后没有变化,使用群昵称再次移除
|
||||||
pattern = f"@{re.escape(context['msg'].self_display_name)}(\u2005|\u0020)"
|
pattern = f"@{re.escape(context['msg'].self_display_name)}(\u2005|\u0020)"
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
"channel_type": "wx",
|
"channel_type": "wx",
|
||||||
"proxy": "",
|
"proxy": "",
|
||||||
"hot_reload": false,
|
"hot_reload": false,
|
||||||
"claude_api_cookie": "",
|
|
||||||
"single_chat_prefix": [
|
"single_chat_prefix": [
|
||||||
"bot",
|
"bot",
|
||||||
"@bot"
|
"@bot"
|
||||||
|
|||||||
Reference in New Issue
Block a user