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)