Fix is_at
This commit is contained in:
parent
14cfb90660
commit
17d6acd432
@ -49,8 +49,16 @@ class WxMsg():
|
|||||||
|
|
||||||
def is_at(self, wxid) -> bool:
|
def is_at(self, wxid) -> bool:
|
||||||
"""是否被 @:群消息,在 @ 名单里,并且不是 @ 所有人"""
|
"""是否被 @:群消息,在 @ 名单里,并且不是 @ 所有人"""
|
||||||
return self.from_group() and re.findall(
|
if not self.from_group():
|
||||||
f"<atuserlist>.*({wxid}).*</atuserlist>", self.xml) and not re.findall(r"@(?:所有人|all|All)", self.content)
|
return False # 只有群消息才能 @
|
||||||
|
|
||||||
|
if not re.findall(f"<atuserlist>.*({wxid}).*</atuserlist>", self.xml):
|
||||||
|
return False # 不在 @ 清单里
|
||||||
|
|
||||||
|
if re.findall(r"@(?:所有人|all|All)", self.content):
|
||||||
|
return False # 排除 @ 所有人
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def is_text(self) -> bool:
|
def is_text(self) -> bool:
|
||||||
"""是否文本消息"""
|
"""是否文本消息"""
|
||||||
|
Loading…
Reference in New Issue
Block a user