From b2b669d57d0578e3d098e2de4dcf04a35e7d09f2 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Fri, 21 Jan 2022 13:26:58 +0000 Subject: [PATCH] Update dashboard hook to understand BTC --- handler/agora.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/handler/agora.py b/handler/agora.py index 9cd626f..dc8b489 100644 --- a/handler/agora.py +++ b/handler/agora.py @@ -123,7 +123,12 @@ class Agora(object): current_trades.append(reference) buyer = contact["data"]["buyer"]["username"] amount = contact["data"]["amount"] - amount_xmr = contact["data"]["amount_xmr"] + if "amount_xmr" in contact["data"]: + amount_crypto = contact["data"]["amount_xmr"] + crypto = "XMR" + elif "amount_btc" in contact["data"]: + amount_crypto = contact["data"]["amount_btc"] + crypto = "BTC" currency = contact["data"]["currency"] if not contact["data"]["is_selling"]: continue @@ -133,7 +138,7 @@ class Agora(object): if reference not in current_trades: current_trades.append(reference) # Let us know there is a new trade - self.irc.sendmsg(f"AUTO {reference}: {buyer} {amount}{currency} {amount_xmr}XMR") + self.irc.sendmsg(f"AUTO {reference}: {buyer} {amount}{currency} {amount_crypto}{crypto}") # Note that we have seen this reference self.last_dash.add(reference)