🐛 修复TaskInfo状态判断

This commit is contained in:
HibiKier 2024-08-05 00:20:27 +08:00
parent 2926a46ae8
commit 1dbed2beec
3 changed files with 8 additions and 12 deletions

View File

@ -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")

View File

@ -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)

View File

@ -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: