support "dices" spelling for dice trigger
fixes #1255 (except for not converting "two" into 2)master
parent
5f5c510480
commit
a2c3f19b9d
|
@ -76,7 +76,7 @@ handle remainder_lc => sub {
|
|||
my $heading = "Random Dice Roll";
|
||||
my $total; # total of all dice rolls
|
||||
foreach (@values) {
|
||||
if ($_ =~ /^(?:a? ?die|(\d{0,2})\s*dic?e)$/) {
|
||||
if ($_ =~ /^(?:a? ?die|(\d{0,2})\s*dic?es?)$/) {
|
||||
# ex. 'a die', '2 dice', '5dice'
|
||||
my @output;
|
||||
my $sum = 0;
|
||||
|
|
14
t/Dice.t
14
t/Dice.t
|
@ -30,6 +30,20 @@ ddg_goodie_test(
|
|||
}
|
||||
}
|
||||
),
|
||||
'throw dices' => test_zci(
|
||||
qr/^., .$/,
|
||||
structured_answer => {
|
||||
id => 'dice',
|
||||
name => 'Answer',
|
||||
data => '-ANY-',
|
||||
templates => {
|
||||
group => 'text',
|
||||
options => {
|
||||
subtitle_content => 'DDH.dice.subtitle_content'
|
||||
}
|
||||
}
|
||||
}
|
||||
),
|
||||
'roll dice' => test_zci(
|
||||
qr/^., .$/,
|
||||
structured_answer => {
|
||||
|
|
Loading…
Reference in New Issue