mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
fix: escape regex patterns when matching name
This commit is contained in:
@@ -115,7 +115,7 @@ class ChatChannel(Channel):
|
||||
if not conf().get("group_at_off", False):
|
||||
flag = True
|
||||
pattern = f"@{self.name}(\u2005|\u0020)"
|
||||
content = re.sub(pattern, r"", content)
|
||||
content = re.sub(re.escape(pattern), r"", content)
|
||||
|
||||
if not flag:
|
||||
if context["origin_ctype"] == ContextType.VOICE:
|
||||
|
||||
Reference in New Issue
Block a user