From fb02c61653900127572398ce0867da72cb50603b Mon Sep 17 00:00:00 2001 From: moneromooo Date: Sun, 25 Jan 2015 12:36:04 +0000 Subject: [PATCH] dice: min/max multipliers are now configurable --- tipbot/config.py | 2 ++ tipbot/modules/dice.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tipbot/config.py b/tipbot/config.py index 95cea10..ba0c18e 100644 --- a/tipbot/config.py +++ b/tipbot/config.py @@ -45,6 +45,8 @@ silent_invalid_commands = { 'freenode': ['price','worth','net','pools','calc'] } +dice_min_multiplier=1.1 +dice_max_multiplier=10 dice_edge = 0.01 dice_max_bet = 5 dice_min_bet = 0.001 diff --git a/tipbot/modules/dice.py b/tipbot/modules/dice.py index a2c29bf..1039146 100644 --- a/tipbot/modules/dice.py +++ b/tipbot/modules/dice.py @@ -55,8 +55,8 @@ def Dice(link,cmd): except Exception,e: link.send("Usage: dice amount multiplier [over|under]") return - if multiplier < 1.1 or multiplier > 10: - link.send("Invalid multiplier: should be between 1.1 and 10") + if multiplier < float(config.dice_min_multiplier) or multiplier > float(config.dice_max_multiplier): + link.send("Invalid multiplier: should be between %f and %f" % (config.dice_min_multiplier, config.dice_max_multiplier)) return if overunder == "over": under=False