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