From 1dbed2beec2616ae46943e7354ee693084f72c46 Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Mon, 5 Aug 2024 00:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8DTaskInfo?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/builtin_plugins/scheduler/morning.py | 4 ++-- zhenxun/models/task_info.py | 2 +- zhenxun/utils/platform.py | 14 +++++--------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/zhenxun/builtin_plugins/scheduler/morning.py b/zhenxun/builtin_plugins/scheduler/morning.py index c254d5e8..acda4b80 100644 --- a/zhenxun/builtin_plugins/scheduler/morning.py +++ b/zhenxun/builtin_plugins/scheduler/morning.py @@ -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") diff --git a/zhenxun/models/task_info.py b/zhenxun/models/task_info.py index 7ed1c1c5..90aa3c08 100644 --- a/zhenxun/models/task_info.py +++ b/zhenxun/models/task_info.py @@ -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) diff --git a/zhenxun/utils/platform.py b/zhenxun/utils/platform.py index d56beb99..a880c877 100644 --- a/zhenxun/utils/platform.py +++ b/zhenxun/utils/platform.py @@ -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: