semicolon support. multiple rolls on one line, separated by ;
This commit is contained in:
parent
ec2be10aca
commit
9f6ae529fe
|
@ -189,9 +189,12 @@ def sub_countdown(connection, event, nick, userhost, replypath, what, admin_unlo
|
|||
#####
|
||||
|
||||
def sub_dice(connection, event, nick, userhost, replypath, what, admin_unlocked):
|
||||
overallroll = what
|
||||
|
||||
rolls = re.split(';\s*', overallroll)
|
||||
for roll in rolls:
|
||||
pattern = '^(?:(\d+)#)?(?:(\d+)/)?(\d+)?d(\d+)(?:(\+|\-)(\d+))?(?:\s+(.*))?'
|
||||
regex = re.compile(pattern)
|
||||
roll = what
|
||||
matches = regex.search(roll)
|
||||
|
||||
if matches is not None:
|
||||
|
|
Loading…
Reference in New Issue