split roll string and properly ignore "roll" from roll attempt

This commit is contained in:
Brian S. Stephan 2010-09-04 12:04:24 -05:00
parent 5b44b66c4d
commit 27b27ecb61
1 changed files with 3 additions and 3 deletions

View File

@ -26,10 +26,10 @@ from Module import Module
class Dice(Module):
def do(self, connection, event, nick, userhost, replypath, what, admin_unlocked):
overallroll = what
whats = what.split(' ')
if what.split(' ')[0] == 'roll':
rolls = re.split(';\s*', overallroll)
if whats[0] == 'roll':
rolls = re.split(';\s*', ' '.join(whats[1:]))
reply = ""
for roll in rolls:
pattern = '^(?:(\d+)#)?(?:(\d+)/)?(\d+)?d(\d+)(?:(\+|\-)(\d+))?(?:\s+(.*))?'