aboutsummaryrefslogtreecommitdiff
path: root/geldschieberbot.py
diff options
context:
space:
mode:
Diffstat (limited to 'geldschieberbot.py')
-rw-r--r--geldschieberbot.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/geldschieberbot.py b/geldschieberbot.py
index e33ba04..9626860 100644
--- a/geldschieberbot.py
+++ b/geldschieberbot.py
@@ -23,15 +23,19 @@ def send(msg):
def create_summary(user):
summary = ""
+ total = 0
p_balances = balance[user] # failes if user is not in balance
for person in p_balances:
amount = p_balances[person]
if amount == 0:
continue
+ total -= amount
summary += "\t" + ("<-" if amount < 0 else "->")
summary += " " + person + " " + str(abs(amount)) + "\n"
if summary == "":
summary = "\tAll fine :)\n"
+ else:
+ summary = "\tBalance: " + str(total)
summary = user + ":\n" + summary
return summary