fix: escape regex patterns when matching name

This commit is contained in:
lanvent
2023-04-22 11:29:41 +08:00
parent ffe4ea5e4c
commit 361f599df0
2 changed files with 2 additions and 2 deletions

View File

@@ -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: