Files
DanDingNoneBot/danding_bot/plugins/group_horse_racing/commands/help.py
Mr.Xia a952760cf8 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
2026-05-02 15:38:34 +08:00

50 lines
1.8 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from nonebot import on_command
from nonebot.adapters.onebot.v11 import Bot, Event
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"""🏇 赛马游戏帮助
📌 命令列表:
/赛马报名 <马匹名> - 报名参赛最多8匹马
/赛马报名 - 复用上次绑定的马名,若无则使用群昵称
/赛马取消报名 - 取消报名并退还下注
/赛马下注 <序号|马匹名> <金额> - 下注
/赛马取消下注 - 取消本人在当前房间的所有下注并退还积分
/赛马赔率 - 查看当前赔率和下注池
/赛马列表 - 查看当前报名马匹列表
/赛马开赛 - 开始比赛至少2匹马
/赛马帮助 - 显示此帮助
📏 规则说明:
• 最低下注金额:{config.MIN_BET} 积分
• 参赛马匹上限8匹
• 开赛要求至少2匹马报名
• 手动开赛权限:仅当前参赛者或群管理员可操作
💰 奖励机制:
• 参赛奖励:参赛者均可获得 {config.PARTICIPANT_REWARD} 积分
• 冠军马主:获得 {config.CHAMPION_REWARD} 积分
• 下注中奖:下注金额 × 赔率
📊 赔率说明:
• 赔率根据各马匹下注总额动态计算
• 下注越少的马,赔率越高
• 最低赔率:{config.MIN_ODDS}
🎮 游戏流程:
1⃣ 玩家报名并绑定马匹名
2⃣ 玩家可以给任意马匹下注
3⃣ 满足开赛后,由参赛者或管理员开赛
4⃣ 比赛实时进行,定期播报进度
5⃣ 比赛结束后结算积分和奖金"""
await help_cmd.finish(help_text)