fix: break circular import in horse racing commands
Extract shared.py from commands/__init__.py to break circular dependency: - shared.py: shared variables/services/helper functions - access.py: get_scope/check_access/get_event_id (canonical source) - __init__.py: re-exports from shared.py for backward compat - register/bet/race/help: import from .shared instead of package
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
from nonebot import on_command
|
||||
from nonebot.adapters.onebot.v11 import Bot, Event
|
||||
from . import config, logger, get_scope, check_access
|
||||
from .shared import config, get_scope, check_access
|
||||
|
||||
help_cmd = on_command("赛马帮助", priority=5)
|
||||
|
||||
|
||||
@help_cmd.handle()
|
||||
async def handle_help(bot: Bot, event: Event):
|
||||
"""Handle help command."""
|
||||
if not await check_access(bot, event):
|
||||
await help_cmd.finish("无权限访问此功能")
|
||||
return
|
||||
help_text = f"""🏇 赛马游戏帮助
|
||||
|
||||
📌 命令列表:
|
||||
|
||||
Reference in New Issue
Block a user