hitomi/dice/__init__.py
Brian S. Stephan ca61d8ac04 roll simple and complicated dice
copy and paste of the dice module from dr.botzo, uses ply
2018-01-08 12:40:19 -06:00

16 lines
424 B
Python

"""Roll dice and do other randomization type operations."""
from bot import hitomi
from dice import lib
@hitomi.command()
async def choose(*choices: str):
"""Randomly select one item from multiple choices."""
await hitomi.say(lib.choose(*choices))
@hitomi.command()
async def roll(*, roll_str: str):
"""Provided a dice string, roll the dice and return the result."""
await hitomi.say(lib.roll(roll_str))