From d15e047bc1193f8c773f84bbfe3c2eca0351ff78 Mon Sep 17 00:00:00 2001 From: Julian Marcos Date: Wed, 4 Oct 2023 17:46:35 +0000 Subject: [PATCH] [cleanwash]: Inform the user if they don't have TCN in Ju. Inform the user that they don't have TCN in Ju. I know this should be rewritten using arpgarse probably to make my life easier, but I don't know how I'd represent the help, maybe making `-h` send help (in many messages) to privmsg. Suggestions welcome. --- plugins/tildewash.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/tildewash.py b/plugins/tildewash.py index f034296..15b9d84 100644 --- a/plugins/tildewash.py +++ b/plugins/tildewash.py @@ -26,6 +26,7 @@ def cleanwash_money(msg): nick = msg.nick if msg.nick in msg.ops and msg.arg: nick = msg.arg balance = Decimal(subprocess.check_output(['/home/jmjl/bin/coin','Ju','internal_balance',nick],universal_newlines=True)) + if balance == Decimal(0): return pinhook.plugin.message("You don't have any tildecoins with us, so you can't cleanwash") subprocess.check_output(['/home/jmjl/bin/coin','Ju','add_internal_balance',nick,f'-{str(balance)}'],universal_newlines=True).strip() new_balance = Decimal(randint(80,110))/Decimal(100)*Decimal(balance) new_balance = new_balance.quantize(Decimal('1.'), rounding=ROUND_DOWN)