From 621198c7c12b1c3e34bcea5361546c423d445f6f Mon Sep 17 00:00:00 2001 From: "Brian Donohoe (creftos)" Date: Sun, 28 Sep 2014 14:40:48 -0700 Subject: [PATCH] [dice] Add a reply if .dice/.roll is called without arguments. --- dice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dice.py b/dice.py index 4dd981f6d4..dbb5109268 100644 --- a/dice.py +++ b/dice.py @@ -171,6 +171,8 @@ def roll(bot, trigger): # Get a list of all dice expressions, evaluate them and then replace the # expressions in the original string with the results. Replacing is done # using string formatting, so %-characters must be escaped. + if not trigger.group(2): + return bot.reply("No dice to roll.") arg_str = trigger.group(2) dice_expressions = re.findall(dice_regexp, arg_str) arg_str = arg_str.replace("%", "%%")