From 75ebebc7575258111c100609909c43aeb14cd4ab Mon Sep 17 00:00:00 2001 From: moneromooo Date: Mon, 19 Jan 2015 20:54:54 +0000 Subject: [PATCH] Move house_balance to betutils --- tipbot/betutils.py | 17 +++++++++++++++++ tipbot/modules/dice.py | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tipbot/betutils.py b/tipbot/betutils.py index 880adc4..81948ec 100644 --- a/tipbot/betutils.py +++ b/tipbot/betutils.py @@ -220,6 +220,15 @@ def RetrieveHouseBalance(): return return unlocked_balance +def GetHouseBalance(link,cmd): + try: + balance = RetrieveHouseBalance() + except Exception,e: + log_error('Failed to retrieve house balance: %s' % str(e)) + link.send('An error occured') + return + link.send('House balance: %s' % AmountToString(balance)) + def ReserveBalance(link,cmd): rbal=GetParam(cmd,1) if rbal: @@ -269,3 +278,11 @@ RegisterCommand({ 'admin': True, 'help': "Set or get reserve balance (not part of the house balance)" }) +RegisterCommand({ + 'module': 'betting', + 'name': 'house_balance', + 'function': GetHouseBalance, + 'admin': True, + 'registered': True, + 'help': "get the house balance" +}) diff --git a/tipbot/modules/dice.py b/tipbot/modules/dice.py index dffc714..ce869a2 100644 --- a/tipbot/modules/dice.py +++ b/tipbot/modules/dice.py @@ -24,15 +24,6 @@ from tipbot.command_manager import * from tipbot.redisdb import * from tipbot.betutils import * -def GetHouseBalance(link,cmd): - try: - balance = RetrieveHouseBalance() - except Exception,e: - log_error('Failed to retrieve house balance: %s' % str(e)) - link.send('An error occured') - return - link.send('House balance: %s' % AmountToString(balance)) - def Roll(link): identity=link.identity() try: @@ -282,14 +273,6 @@ RegisterCommand({ 'registered': True, 'help': "resets your dice stats" }) -RegisterCommand({ - 'module': __name__, - 'name': 'house_balance', - 'function': GetHouseBalance, - 'admin': True, - 'registered': True, - 'help': "get the house balance" -}) RegisterCommand({ 'module': __name__, 'name': 'playerseed',