Permalink
Browse files

Make dice actually work!

  • Loading branch information...
jordane committed Sep 7, 2011
1 parent d624a9b commit 37d022bf0776a4cf46d392c4386bb77f22abc6f1
Showing with 4 additions and 5 deletions.
  1. +4 −5 hamper/plugins/commands.py
@@ -93,16 +93,15 @@ def roll(num, sides, add):
class Dice(Plugin):
"""Random dice rolls!"""
name = 'dice'
- onlyDirected = True
- priority = 3
- regex = '((\d*)d)?(\d*)(\+(\d*))?'
+ priority = 0
class DiceCommand(Command):
onlyDirected = True
- regex = '((\d*)d)?(\d*)(\+(\d*))?'
+ #regex = '^(\d*)d(?:ice)?(\d*)(\+(\d*))?$'
+ regex = '^(\d*)d(?:ice)?(\d*)\+?(\d*)$'
def command(self, bot, com, groups):
- _, num, sides,_, add = groups
+ num, sides, add = groups
if not num:
num = 1

0 comments on commit 37d022b

Please sign in to comment.