From ee7562803a7ba55c1c0453b26d8b71de2720314f Mon Sep 17 00:00:00 2001 From: Mike Stark Date: Thu, 10 Dec 2015 10:50:34 -0500 Subject: [PATCH] [dice] Also handle negative drop_lowest values. --- sopel/modules/dice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sopel/modules/dice.py b/sopel/modules/dice.py index ab4f62ff8f..0e5336533c 100644 --- a/sopel/modules/dice.py +++ b/sopel/modules/dice.py @@ -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