diff --git a/src/Miscellaneous/Dice.coffee b/src/Miscellaneous/Dice.coffee index 67559eca4..93bdb06cd 100644 --- a/src/Miscellaneous/Dice.coffee +++ b/src/Miscellaneous/Dice.coffee @@ -5,12 +5,7 @@ Dice = name: 'Show Dice Roll' cb: @node node: -> - return if @isClone or not dicestats = @info.email?.match /dice\+(\d+)d(\d+)/ + return if @isClone or not dicestats = @info.email?.match /dice[+\s](\d+)d(\d+)/ # Use the text node directly, as the has two
. roll = $('b', @nodes.comment).firstChild - # Stop here if it looks like this: - # Rolled 44 - # and not this: - # Rolled 9, 8, 10, 3, 5 = 35 - return unless rollResults = roll.textContent.match /^Rolled (\d+)$/ - roll.textContent = "Rolled #{dicestats[1]}d#{dicestats[2]} and got #{rollResults[1]}" + roll.data = "Rolled #{dicestats[1]}d#{dicestats[2]} and got #{roll.data.slice 7}"