From b74fb669393a66a4af8d5e29e95b90967be4286d Mon Sep 17 00:00:00 2001 From: webjoin111 <455457521@qq.com> Date: Wed, 29 Oct 2025 16:30:39 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(schedulerAdmin):=20=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E3=80=81=E6=9A=82=E5=81=9C=E3=80=81=E6=81=A2=E5=A4=8D=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E6=94=AF=E6=8C=81=E5=A4=9AID=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/builtin_plugins/scheduler_admin/commands.py | 12 ++++++------ .../builtin_plugins/scheduler_admin/dependencies.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/zhenxun/builtin_plugins/scheduler_admin/commands.py b/zhenxun/builtin_plugins/scheduler_admin/commands.py index 955875de..6391cc85 100644 --- a/zhenxun/builtin_plugins/scheduler_admin/commands.py +++ b/zhenxun/builtin_plugins/scheduler_admin/commands.py @@ -147,8 +147,8 @@ schedule_cmd = on_alconna( Subcommand( "删除", Args[ - "schedule_id?", - int, + "schedule_ids?", + MultiVar(int), Field(unmatch_tips=lambda text: f"任务ID '{text}' 必须是数字!"), ], *create_targeting_options(), @@ -158,8 +158,8 @@ schedule_cmd = on_alconna( Subcommand( "暂停", Args[ - "schedule_id?", - int, + "schedule_ids?", + MultiVar(int), Field(unmatch_tips=lambda text: f"任务ID '{text}' 必须是数字!"), ], *create_targeting_options(), @@ -169,8 +169,8 @@ schedule_cmd = on_alconna( Subcommand( "恢复", Args[ - "schedule_id?", - int, + "schedule_ids?", + MultiVar(int), Field(unmatch_tips=lambda text: f"任务ID '{text}' 必须是数字!"), ], *create_targeting_options(), diff --git a/zhenxun/builtin_plugins/scheduler_admin/dependencies.py b/zhenxun/builtin_plugins/scheduler_admin/dependencies.py index 6151f801..1f1e1ac5 100644 --- a/zhenxun/builtin_plugins/scheduler_admin/dependencies.py +++ b/zhenxun/builtin_plugins/scheduler_admin/dependencies.py @@ -158,7 +158,7 @@ async def GetTargeter( event: Event, bot: Bot, arp: Arparma = AlconnaMatches(), - schedule_id: Match[int] = AlconnaMatch("schedule_id"), + schedule_ids: Match[list[int]] = AlconnaMatch("schedule_ids"), plugin_name: Match[str] = AlconnaMatch("plugin_name"), group_ids: Match[list[str]] = AlconnaMatch("group_ids"), user_id: Match[str] = AlconnaMatch("user_id"), @@ -172,8 +172,8 @@ async def GetTargeter( if not subcommand: await matcher.finish("内部错误:无法解析子命令。") - if schedule_id.available: - return scheduler_manager.target(id=schedule_id.result) + if schedule_ids.available: + return scheduler_manager.target(id__in=schedule_ids.result) all_enabled = arp.query(f"{subcommand}.all.value", False) global_flag = arp.query(f"{subcommand}.global.value", False)