From 0ed20f9a4a817363bb50d60e3bfec99488528c6f Mon Sep 17 00:00:00 2001 From: "Mr.Xia" <1424473282@qq.com> Date: Sun, 3 May 2026 10:37:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20rules.py=20ALLOWED=5FGROUPS=E2=86=92ALLO?= =?UTF-8?q?WED=5FGROUP=5FID=E6=95=B4=E6=95=B0=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- danding_bot/plugins/onmyoji_gacha/rules.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/danding_bot/plugins/onmyoji_gacha/rules.py b/danding_bot/plugins/onmyoji_gacha/rules.py index 082bbd7..7ab7cd1 100644 --- a/danding_bot/plugins/onmyoji_gacha/rules.py +++ b/danding_bot/plugins/onmyoji_gacha/rules.py @@ -16,7 +16,7 @@ def _check_group_allowed(config) -> Callable: """生成群组权限检查函数(内部复用,消除重复逻辑)。 Args: - config: Config实例,需包含ALLOWED_GROUPS属性 + config: Config实例,需包含ALLOWED_GROUP_ID属性 Returns: 异步检查函数,私聊放行、群聊检查白名单 @@ -24,7 +24,8 @@ def _check_group_allowed(config) -> Callable: async def _check(bot: Bot, event: MessageEvent) -> bool: if not isinstance(event, GroupMessageEvent): return True - return str(event.group_id) in config.ALLOWED_GROUPS + # 单群模式:直接比较整数 + return event.group_id == config.ALLOWED_GROUP_ID return _check