Skip to content

Commit

Permalink
[dice] Also handle negative drop_lowest values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganon11 committed Dec 10, 2015
1 parent bb4af03 commit ee75628
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sopel/modules/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ def _roll_dice(bot, dice_expression):

if result.group('drop_lowest'):
drop = int(result.group('drop_lowest'))
dice.drop_lowest(drop)
if drop >= 0:
dice.drop_lowest(drop)
else:
bot.reply("I can't drop the lowest %d dice. =(" % drop)

return dice

Expand Down

0 comments on commit ee75628

Please sign in to comment.