fix: escape regex pattern

This commit is contained in:
lanvent
2023-04-22 11:39:59 +08:00
parent 361f599df0
commit 4af2c7f3d7
2 changed files with 4 additions and 4 deletions

View File

@@ -114,8 +114,8 @@ class ChatChannel(Channel):
logger.info("[WX]receive group at")
if not conf().get("group_at_off", False):
flag = True
pattern = f"@{self.name}(\u2005|\u0020)"
content = re.sub(re.escape(pattern), r"", content)
pattern = f"@{re.escape(self.name)}(\u2005|\u0020)"
content = re.sub(pattern, r"", content)
if not flag:
if context["origin_ctype"] == ContextType.VOICE: