diff options
| author | 2018-11-02 13:07:46 +0000 | |
|---|---|---|
| committer | 2018-11-02 13:07:46 +0000 | |
| commit | 44f3e241d260ca730e20f7ab8abe3080f772a3b7 (patch) | |
| tree | ef412c729b88a3141de4601e45502c0f6636b74d /modules | |
| parent | Show !coins in a human format (with ","s) (diff) | |
| signature | ||
Don't let users bet 0 coins
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/coins.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/coins.py b/modules/coins.py index d88c1b44..cd4e8b27 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -6,10 +6,12 @@ DEFAULT_REDEEM_DELAY = 600 # 600 seconds, 10 minutes DEFAULT_REDEEM_AMOUNT = "100.0" DEFAULT_INTEREST_RATE = "0.01" INTEREST_INTERVAL = 60*60 # 1 hour -DECIMAL_ZERO = decimal.Decimal("0") REGEX_FLOAT = re.compile("(?:\d+(?:\.\d{1,2}|$)|\.\d{1,2})") DEFAULT_MARKET_CAP = str(1_000_000_000) +DECIMAL_ZERO = decimal.Decimal("0") +DECIMAL_BET_MINIMUM = decimal.Decimal("0.01") + HOUR_SECONDS = (1*60)*60 LOTTERY_INTERVAL = (60*60)*6 # 6 hours LOTTERY_BUYIN = "100.00" @@ -397,7 +399,7 @@ class Module(ModuleManager.BaseModule): event["user"].nickname) else: try: - coin_bet = self._parse_coins(coin_bet, DECIMAL_ZERO) + coin_bet = self._parse_coins(coin_bet, DECIMAL_BET_MINIMUM) except CoinParseException as e: raise utils.EventError("%s: %s" % (event["user"].nickname, str(e))) @@ -541,7 +543,8 @@ class Module(ModuleManager.BaseModule): for i, bet_amount in enumerate(bet_amounts): try: - bet_amounts[i] = self._parse_coins(bet_amount, DECIMAL_ZERO) + bet_amounts[i] = self._parse_coins(bet_amount, + DECIMAL_BET_MINIMUM) except CoinParseException as e: raise utils.EventError("%s: %s" % (event["user"].nickname, str(e))) |
