"""Roll dice and do other randomization type operations."""
import logging

from bot import hitomi
from dice import lib

logger = logging.getLogger(__name__)
logger.info("loading dice plugin")


@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))