split roll string and properly ignore "roll" from roll attempt
This commit is contained in:
parent
5b44b66c4d
commit
27b27ecb61
@ -26,10 +26,10 @@ from Module import Module
|
|||||||
class Dice(Module):
|
class Dice(Module):
|
||||||
|
|
||||||
def do(self, connection, event, nick, userhost, replypath, what, admin_unlocked):
|
def do(self, connection, event, nick, userhost, replypath, what, admin_unlocked):
|
||||||
overallroll = what
|
whats = what.split(' ')
|
||||||
|
|
||||||
if what.split(' ')[0] == 'roll':
|
if whats[0] == 'roll':
|
||||||
rolls = re.split(';\s*', overallroll)
|
rolls = re.split(';\s*', ' '.join(whats[1:]))
|
||||||
reply = ""
|
reply = ""
|
||||||
for roll in rolls:
|
for roll in rolls:
|
||||||
pattern = '^(?:(\d+)#)?(?:(\d+)/)?(\d+)?d(\d+)(?:(\+|\-)(\d+))?(?:\s+(.*))?'
|
pattern = '^(?:(\d+)#)?(?:(\d+)/)?(\d+)?d(\d+)(?:(\+|\-)(\d+))?(?:\s+(.*))?'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user