mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-05 03:39:59 +08:00
🐛 统一被动技能判断
This commit is contained in:
@@ -12,10 +12,8 @@ from zhenxun.configs.config import NICKNAME, Config
|
||||
from zhenxun.configs.path_config import TEMP_PATH
|
||||
from zhenxun.configs.utils import PluginExtraData, RegisterConfig, Task
|
||||
from zhenxun.models.task_info import TaskInfo
|
||||
from zhenxun.services.log import logger
|
||||
from zhenxun.utils.enum import PluginType
|
||||
from zhenxun.utils.http_utils import AsyncHttpx
|
||||
from zhenxun.utils.image_utils import get_download_image_hash, get_img_hash
|
||||
from zhenxun.utils.image_utils import get_download_image_hash
|
||||
from zhenxun.utils.rules import ensure_group
|
||||
|
||||
__plugin_meta__ = PluginMetadata(
|
||||
@@ -98,12 +96,11 @@ _matcher = on_message(rule=ensure_group, priority=999)
|
||||
|
||||
@_matcher.handle()
|
||||
async def _(message: UniMsg, event: Event, session: EventSession):
|
||||
task = await TaskInfo.get_or_none(module="fudu")
|
||||
if task and not task.status:
|
||||
group_id = session.id2 or ""
|
||||
if await TaskInfo.is_block("fudu", group_id):
|
||||
return
|
||||
if event.is_tome():
|
||||
return
|
||||
group_id = session.id2 or ""
|
||||
plain_text = message.extract_plain_text()
|
||||
image_list = []
|
||||
for m in message:
|
||||
|
||||
@@ -45,13 +45,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
|
||||
|
||||
async def _rule(session: EventSession) -> bool:
|
||||
task = await TaskInfo.get_or_none(module="bilibili_parse")
|
||||
if not task or not task.status:
|
||||
logger.debug("b站转发解析被动全局关闭,已跳过...")
|
||||
return False
|
||||
if gid := session.id3 or session.id2:
|
||||
return not await GroupConsole.is_block_task(gid, "bilibili_parse")
|
||||
return False
|
||||
return not TaskInfo.is_block("bilibili_parse", session.id3 or session.id2)
|
||||
|
||||
|
||||
_matcher = on_message(priority=1, block=False, rule=_rule)
|
||||
|
||||
Reference in New Issue
Block a user