From cf208e2f6496472f5bab1029498dec7304f4e53f Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Tue, 23 Jul 2024 19:53:42 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20:=E7=BE=A4=E8=A2=AB=E5=8A=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9=E6=97=B6=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/plugin_switch/__init__.py | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/zhenxun/builtin_plugins/admin/plugin_switch/__init__.py b/zhenxun/builtin_plugins/admin/plugin_switch/__init__.py index aa08ae78..ddc0e910 100644 --- a/zhenxun/builtin_plugins/admin/plugin_switch/__init__.py +++ b/zhenxun/builtin_plugins/admin/plugin_switch/__init__.py @@ -79,31 +79,14 @@ async def _( ): if session.id1 in bot.config.superusers: image = await build_plugin() - await Image(image.pic2bytes()).send(reply=True) logger.info( f"查看功能列表", arparma.header_result, session=session, ) + await Image(image.pic2bytes()).finish(reply=True) else: - await Text("权限不足捏...").send(reply=True) - - -@_status_matcher.assign("task") -async def _( - session: EventSession, - arparma: Arparma, -): - image = await build_task(session.id3 or session.id2) - if image: - await Image(image.pic2bytes()).send(reply=True) - logger.info( - f"查看群被动列表", - arparma.header_result, - session=session, - ) - else: - await Text("获取群被动任务失败...").send(reply=True) + await Text("权限不足捏...").finish(reply=True) @_status_matcher.assign("open") @@ -151,7 +134,7 @@ async def _( logger.info( f"开启功能 {name}", arparma.header_result, session=session ) - await Text(result).send(reply=True) + await Text(result).finish(reply=True) elif session.id1 in bot.config.superusers: """私聊""" group_id = group.result if group.available else None @@ -176,22 +159,22 @@ async def _( await Text(result).finish(reply=True) if task.result: result = await PluginManage.superuser_task_handle(name, group_id, True) - await Text(result).send(reply=True) logger.info( f"超级用户开启被动技能 {name}", arparma.header_result, session=session, target=group_id, ) + await Text(result).finish(reply=True) else: result = await PluginManage.superuser_block(name, None, group_id) - await Text(result).send(reply=True) logger.info( f"超级用户开启功能 {name}", arparma.header_result, session=session, target=group_id, ) + await Text(result).finish(reply=True) @_status_matcher.assign("close") @@ -238,7 +221,7 @@ async def _( logger.info( f"关闭功能 {name}", arparma.header_result, session=session ) - await Text(result).send(reply=True) + await Text(result).finish(reply=True) elif session.id1 in bot.config.superusers: group_id = group.result if group.available else None if all.result: @@ -262,13 +245,13 @@ async def _( await Text(result).finish(reply=True) if task.result: result = await PluginManage.superuser_task_handle(name, group_id, False) - await Text(result).send(reply=True) logger.info( f"超级用户关闭被动技能 {name}", arparma.header_result, session=session, target=group_id, ) + await Text(result).finish(reply=True) else: _type = BlockType.ALL if block_type.available: @@ -277,13 +260,13 @@ async def _( elif block_type.result in ["g", "group"]: _type = BlockType.GROUP result = await PluginManage.superuser_block(name, _type, group_id) - await Text(result).send(reply=True) logger.info( f"超级用户关闭功能 {name}, 禁用类型: {_type}", arparma.header_result, session=session, target=group_id, ) + await Text(result).finish(reply=True) @_group_status_matcher.handle() @@ -305,3 +288,20 @@ async def _( logger.info("醒来", arparma.header_result, session=session) await Text("呜..醒来了...").finish() return Text("群组id为空...").send() + + +@_status_matcher.assign("task") +async def _( + session: EventSession, + arparma: Arparma, +): + image = await build_task(session.id3 or session.id2) + if image: + logger.info( + f"查看群被动列表", + arparma.header_result, + session=session, + ) + await Image(image.pic2bytes()).finish(reply=True) + else: + await Text("获取群被动任务失败...").finish(reply=True)