修复qq提取

This commit is contained in:
雅诺狐
2025-08-28 13:37:20 +08:00
committed by Windpicker-owo
parent 3757d444bf
commit 4b0e0f3482

View File

@@ -150,8 +150,8 @@ class PermissionCommand(PlusCommand):
def _parse_user_mention(self, mention: str) -> Optional[str]: def _parse_user_mention(self, mention: str) -> Optional[str]:
"""解析用户提及提取QQ号""" """解析用户提及提取QQ号"""
# 匹配 @用户 格式提取QQ号 # 匹配 @<用户名:QQ号> 格式提取QQ号
at_match = re.search(r'\[CQ:at,qq=(\d+)\]', mention) at_match = re.search(r'@<[^:]+:(\d+)>', mention)
if at_match: if at_match:
return at_match.group(1) return at_match.group(1)