From 56e9473f469c943a0964167230d4dc267b2d4df9 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Tue, 17 Mar 2015 19:29:35 +0000 Subject: [PATCH] tipping: add a monero amount as well as the denominated amount --- tipbot/modules/tipping.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tipbot/modules/tipping.py b/tipbot/modules/tipping.py index 798277c..795dea5 100644 --- a/tipbot/modules/tipping.py +++ b/tipbot/modules/tipping.py @@ -52,7 +52,10 @@ def PerformTip(link,whoid,units): p.hincrby("balances",account,-units); p.hincrby("balances",who_account,units) p.execute() - link.send("%s has tipped %s %s" % (NickFromIdentity(identity), NickFromIdentity(whoid), AmountToString(units))) + if units < coinspecs.atomic_units: + link.send("%s has tipped %s %s (%.16g %s)" % (NickFromIdentity(identity), NickFromIdentity(whoid), AmountToString(units), float(units) / coinspecs.atomic_units, coinspecs.name)) + else: + link.send("%s has tipped %s %s" % (NickFromIdentity(identity), NickFromIdentity(whoid), AmountToString(units))) except Exception, e: log_error("Tip: Error updating redis: %s" % str(e)) link.send("An error occured")