From 2cb01954d495e2d21cdf497b7f3dfc9077830ab0 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Fri, 23 Jan 2015 11:37:26 +0000 Subject: [PATCH] Fix report mixing up win/loss, and make it a bit more compact --- tipbot/betutils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tipbot/betutils.py b/tipbot/betutils.py index 440676c..00546ba 100644 --- a/tipbot/betutils.py +++ b/tipbot/betutils.py @@ -395,10 +395,12 @@ def Report(link,cmd): lost+=long(redis_zscore(zdtname+"lost",tsd) or 0) if days in period.keys(): if won>lost: - balance_change="+"+AmountToString(won-lost) + wonlost='lost' + balance_change=AmountToString(won-lost) else: - balance_change="-"+AmountToString(lost-won) - link.send('%s: %d bets %s, %s wagered, %s house balance change' % (game,bets,period[days],AmountToString(wagered),balance_change)) + wonlost='won' + balance_change=AmountToString(lost-won) + link.send('%s, %s: %d bets, %s wagered, house %s %s' % (game,period[days],bets,AmountToString(wagered),wonlost,balance_change)) except Exception,e: log_error('Failed to generate report for %s: %s' % (game,str(e))) link.send('Failed to generate report for %s' % game)