修复:group_horse_racing 环境变量加载问题
- 修改 __init__.py 在插件初始化时加载 Config - 修改 commands.py 和 test_commands.py 从 __init__.py 导入 plugin_config - 确保配置通过 NoneBot 的 driver 正确加载环境变量 - 这样可以正确解析 .env 中的 JSON 格式环境变量 这解决了权限检查中 TESTERS 集合为空的问题。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
from nonebot import on_command
|
||||
from nonebot.adapters.onebot.v11 import Bot, Event, GroupMessageEvent, PrivateMessageEvent
|
||||
|
||||
from .config import Config
|
||||
from .room_store import RoomStore
|
||||
from .points_service import PointsService
|
||||
from .race_engine import RaceEngine
|
||||
from .message_service import MessageService
|
||||
from .models import Room, Horse, Bet, HorseState
|
||||
|
||||
config = Config()
|
||||
# Import config from __init__ to ensure it's loaded through NoneBot driver
|
||||
from . import plugin_config as config
|
||||
|
||||
room_store = RoomStore(config)
|
||||
points_service = PointsService(config)
|
||||
race_engine = RaceEngine(config)
|
||||
|
||||
Reference in New Issue
Block a user