@@ -0,0 +1,790 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22%0A:mod:%60gygax.modules.roll%60 --- Module for rolling dice.%0A=================================================================%0A%22%22%22%0A%0Aimport random%0A%0Adef roll(bot, sender, text):%0A    if not text:%0A        bot.reply(%22.roll what?%22)%0A        return%0A    try:%0A        count, size = text.split(%22d%22, 1)%0A        count = int(count) if len(count) else 1%0A        size = int(size)%0A        if count %3C 1 or count %3E 10 or size %3C 1 or size %3E 100:%0A            raise ValueError%0A    except ValueError:%0A        bot.reply(%22invalid die%22)%0A        return%0A%0A    results = %5B%5D%0A    for i in range(count):%0A        results.append(random.randint(1, size))%0A    bot.reply(str(results%5B0%5D) if count == 1 else %22%7B%7D = %7B%7D%22.format(%0A            %22 + %22.join(map(str, results)), sum(results)))%0Aroll.command = %22.roll%22%0A

Implement dice rolling module.