Skip to content

Commit

Permalink
Merge pull request #215 from lunakv/regex-update-fix
Browse files Browse the repository at this point in the history
Actual roll command fix
  • Loading branch information
Fryyyyy authored Nov 21, 2023
2 parents 4bc2b75 + 19e30c7 commit 73d05e3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion dice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func TestRollDice(t *testing.T) {
{"2d6+e", plannedFailure},
{"2e6?_", plannedFailure},
{"-3d8", plannedFailure},
{"kd4", plannedError},
{"3d1", plannedError},
{"2d112", plannedError},
{"4d0", plannedError},
Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (
wordEndingInBang = regexp.MustCompile(`!["'] |\n+`)
wordStartingWithBang = regexp.MustCompile(`\s+! *\S+`)

diceRegex = regexp.MustCompile(`^(?:roll )?\s*(.*?)d(\d+)([+-]\d+)?`)
diceRegex = regexp.MustCompile(`^(?:roll\s+)?(\d*)d(\d+)([+-]\d+)?`)

cardMetadataRegex = regexp.MustCompile(`(?i)^(?:rulings?|reminder|flavou?r) `)

Expand Down

0 comments on commit 73d05e3

Please sign in to comment.