Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/dice/__init__.py
2023-01-26 15:16:11 +08:00

13 lines
508 B
Python

from core.builtins.message import MessageSession
from core.component import on_command
from .dice import roll
dice = on_command('dice', alias={'d20': 'dice d20', 'd100': 'dice d100',
'd6': 'dice d6'}, developers=['Light-Beacon'], desc='随机骰子',)
@dice.handle('<dices> [<dc>] {摇动指定骰子,可指定 dc 判断判定。}',)
async def _(msg: MessageSession):
dice = msg.parsed_msg['<dices>']
dc = msg.parsed_msg.get('<dc>', 0)
await msg.finish(await roll(dice, dc))