from random import randint
from . import ultroid_cmd

@ultroid_cmd(pattern="roll( ([\d ]+)|$)")
async def yyy_yyy(e):
  args = e.pattern_match.group(2)
  spl = args.split(maxsplit=1)
  _min = 0 if len(spl) == 1 else int(spl[0])
  _max = int(spl[-1])
  assert _max > _min, "sike"
  ran = randint(_min, _max)
  await e.eor(f"The Random number between {_min} to {_max} is {ran}")