mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-08 04:43:00 +08:00
fix:逻辑优化
This commit is contained in:
parent
4177fd149a
commit
34986c1d4e
@ -111,7 +111,7 @@ class Platform(metaclass=RegistryABCMeta, base=True):
|
|||||||
def set_stored_data(self, target: Target, data: Any):
|
def set_stored_data(self, target: Target, data: Any):
|
||||||
self.store[target] = data
|
self.store[target] = data
|
||||||
|
|
||||||
def tag_separator(self, stored_tags: list[Tag]):
|
def tag_separator(self, stored_tags: list[Tag]) -> tuple[list[Tag], list[Tag]]:
|
||||||
"""返回分离好的正反tag元组"""
|
"""返回分离好的正反tag元组"""
|
||||||
subscribed_tags = []
|
subscribed_tags = []
|
||||||
banned_tags = []
|
banned_tags = []
|
||||||
@ -137,17 +137,16 @@ class Platform(metaclass=RegistryABCMeta, base=True):
|
|||||||
for tag in post_tags or []:
|
for tag in post_tags or []:
|
||||||
if tag in banned_tags:
|
if tag in banned_tags:
|
||||||
return True
|
return True
|
||||||
# 检测屏蔽tag后检测订阅tag
|
# 检测屏蔽tag后,再检测订阅tag
|
||||||
# 存在任意需要订阅的tag则为假
|
# 存在任意需要订阅的tag则为假
|
||||||
ban_it = True
|
|
||||||
if subscribed_tags:
|
if subscribed_tags:
|
||||||
|
ban_it = True
|
||||||
for tag in post_tags or []:
|
for tag in post_tags or []:
|
||||||
if tag in subscribed_tags:
|
if tag in subscribed_tags:
|
||||||
ban_it = False
|
ban_it = False
|
||||||
else:
|
|
||||||
ban_it = False
|
|
||||||
|
|
||||||
return ban_it
|
return ban_it
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
async def filter_user_custom(
|
async def filter_user_custom(
|
||||||
self, raw_post_list: list[RawPost], cats: list[Category], tags: list[Tag]
|
self, raw_post_list: list[RawPost], cats: list[Category], tags: list[Tag]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user