From c063c69dea811ea83f37148badb1c9b52db03c95 Mon Sep 17 00:00:00 2001 From: snowy Date: Sun, 28 Apr 2024 18:52:22 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=20=E4=BF=AE=E5=A4=8D=E7=BE=A4=E8=81=8A?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E5=9C=A8=E5=B8=A6=E5=8F=82=E6=95=B0=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/plugins/liteyuki_pacman/npm.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/liteyuki/plugins/liteyuki_pacman/npm.py b/liteyuki/plugins/liteyuki_pacman/npm.py index d02f5236..5d03df9c 100644 --- a/liteyuki/plugins/liteyuki_pacman/npm.py +++ b/liteyuki/plugins/liteyuki_pacman/npm.py @@ -383,6 +383,7 @@ async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot, npm: Matcher): ) await md.send_md(reply, bot, event=event) + @on_alconna( aliases={"群聊"}, command=Alconna( @@ -403,18 +404,18 @@ async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot, npm: Matcher): async def _(bot: T_Bot, event: T_MessageEvent, gm: Matcher, result: Arparma): ulang = get_user_lang(str(event.user_id)) to_enable = result.subcommands.get(enable) is not None + group_id = None if await SUPERUSER(bot, event): # 仅超级用户可以自定义群号 group_id = result.subcommands.get(enable, result.subcommands.get(disable)).args.get("group_id") - if group_id is None and event.message_type == "group": group_id = str(event.group_id) - else: + + if group_id is None: await gm.finish(ulang.get("liteyuki.invalid_command"), liteyuki_pass=True) enabled = get_group_enable(group_id) - print(enabled, to_enable) if enabled == to_enable: await gm.finish(ulang.get("liteyuki.group_already", STATUS=ulang.get("npm.enable") if to_enable else ulang.get("npm.disable"), GROUP=group_id), liteyuki_pass=True)