mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🐛 修复TaskInfo状态判断
This commit is contained in:
parent
2926a46ae8
commit
1dbed2beec
@ -58,8 +58,8 @@ async def _():
|
||||
# # 睡觉了
|
||||
@scheduler.scheduled_job(
|
||||
"cron",
|
||||
hour=23,
|
||||
minute=59,
|
||||
hour=0,
|
||||
minute=19,
|
||||
)
|
||||
async def _():
|
||||
img = Image(IMAGE_PATH / "zhenxun" / "sleep.jpg")
|
||||
|
||||
@ -35,7 +35,7 @@ class TaskInfo(Model):
|
||||
bool: 是否被禁用
|
||||
"""
|
||||
if task := await cls.get_or_none(module=module):
|
||||
if task.status:
|
||||
if not task.status:
|
||||
return True
|
||||
if group_id:
|
||||
return await GroupConsole.is_block_task(group_id, module)
|
||||
|
||||
@ -615,22 +615,18 @@ async def broadcast_group(
|
||||
)
|
||||
) or key in _used_group:
|
||||
continue
|
||||
is_continue = False
|
||||
is_run = False
|
||||
if check_func:
|
||||
if is_coroutine_callable(check_func):
|
||||
is_continue = not await check_func(
|
||||
group.group_id, group.channel_id
|
||||
)
|
||||
is_run = await check_func(group.group_id)
|
||||
else:
|
||||
is_continue = not check_func(
|
||||
group.group_id, group.channel_id
|
||||
)
|
||||
if is_continue:
|
||||
is_run = check_func(group.group_id)
|
||||
if not is_run:
|
||||
continue
|
||||
target = PlatformUtils.get_target(
|
||||
_bot,
|
||||
None,
|
||||
group.group_id,
|
||||
group.channel_id or group.group_id,
|
||||
# , group.channel_id
|
||||
)
|
||||
if target:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user