From d3e4b99f99473a04aaea32c6924da5db7fa8c5f3 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Thu, 25 Dec 2014 20:43:26 +0000 Subject: [PATCH] Fix amount in tip log --- tipbot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tipbot.py b/tipbot.py index ddd1448..01de9e1 100644 --- a/tipbot.py +++ b/tipbot.py @@ -250,17 +250,17 @@ def Tip(nick,data): except Exception,e: SendTo(sendto, "Usage: tip nick amount") return + units=long(amount*coin) + if units <= 0: + SendTo(sendto, "Invalid amount") + return - log_info("Tip: %s wants to tip %s %s" % (nick, who, AmountToString(amount))) + log_info("Tip: %s wants to tip %s %s" % (nick, who, AmountToString(units))) try: balance = redis.hget("balances",nick) if balance == None: balance = 0 balance=long(balance) - units=long(amount*coin) - if units <= 0: - SendTo(sendto, "Invalid amount") - return if units > balance: SendTo(sendto, "You only have %s" % (AmountToString(balance))) return