diff --git a/commands.py b/commands.py index 9daf0aa..590b266 100644 --- a/commands.py +++ b/commands.py @@ -137,8 +137,8 @@ def cmd_markov(client, msg): def cmd_roll(client, msg): tmp = msg.content[6:] - pattern = re.compile("^(\d+)d(\d+)([+-]\d+)?$") - pattern2 = re.compile("^d(\d+)([+-]\d+)?$") + pattern = re.compile("^(\d+)d(\d+)([+-]\d+)?(.*)?$") + pattern2 = re.compile("^d(\d+)([+-]\d+)?(.*)?$") # extract numbers nums = [int(s) for s in re.findall(r"\d+", tmp)] @@ -155,12 +155,12 @@ def cmd_roll(client, msg): # extract modifier, if any modifier = 0 - modpattern = re.compile("^(\d+)?d(\d+)[+-]\d+$") + modpattern = re.compile("^(\d+)?d(\d+)[+-]\d+(.*)?$") if modpattern.match(tmp): modifier = nums[len(nums) - 1] # negate modifier, if necessary - modpattern = re.compile("^(\d+)?d(\d+)[-]\d+$") + modpattern = re.compile("^(\d+)?d(\d+)\-\d+(.*)?$") if modpattern.match(tmp): modifier = -modifier diff --git a/common.py b/common.py index b470529..6c07716 100644 --- a/common.py +++ b/common.py @@ -10,7 +10,7 @@ import os import json # bot version -version = "v1.2.2" +version = "v1.2.3" # TODO: generate this on the fly and make it look acceptable # text shown by .help command