import random


async def roll(ctx, dice: str):
    """Rolls a dice in NdN format."""   #When existing, the docstring wil be used as command description.
    try:
        rolls, limit = map(int, dice.split('d'))
    except Exception:
        return await ctx.reply('Format has to be in NdN!')

    result = ', '.join(str(random.randint(1, limit)) for r in range(rolls))
    await ctx.reply(result)