🐛 修复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( @scheduler.scheduled_job(
"cron", "cron",
hour=23, hour=0,
minute=59, minute=19,
) )
async def _(): async def _():
img = Image(IMAGE_PATH / "zhenxun" / "sleep.jpg") img = Image(IMAGE_PATH / "zhenxun" / "sleep.jpg")

View File

@ -35,7 +35,7 @@ class TaskInfo(Model):
bool: 是否被禁用 bool: 是否被禁用
""" """
if task := await cls.get_or_none(module=module): if task := await cls.get_or_none(module=module):
if task.status: if not task.status:
return True return True
if group_id: if group_id:
return await GroupConsole.is_block_task(group_id, module) return await GroupConsole.is_block_task(group_id, module)

View File

@ -615,22 +615,18 @@ async def broadcast_group(
) )
) or key in _used_group: ) or key in _used_group:
continue continue
is_continue = False is_run = False
if check_func: if check_func:
if is_coroutine_callable(check_func): if is_coroutine_callable(check_func):
is_continue = not await check_func( is_run = await check_func(group.group_id)
group.group_id, group.channel_id
)
else: else:
is_continue = not check_func( is_run = check_func(group.group_id)
group.group_id, group.channel_id if not is_run:
)
if is_continue:
continue continue
target = PlatformUtils.get_target( target = PlatformUtils.get_target(
_bot, _bot,
None, None,
group.group_id, group.channel_id or group.group_id,
# , group.channel_id # , group.channel_id
) )
if target: if target: