Update dashboard hook to understand BTC

This commit is contained in:
Mark Veidemanis 2022-01-21 13:26:58 +00:00
parent bb1734142d
commit b2b669d57d
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 7 additions and 2 deletions

View File

@ -123,7 +123,12 @@ class Agora(object):
current_trades.append(reference) current_trades.append(reference)
buyer = contact["data"]["buyer"]["username"] buyer = contact["data"]["buyer"]["username"]
amount = contact["data"]["amount"] 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"] currency = contact["data"]["currency"]
if not contact["data"]["is_selling"]: if not contact["data"]["is_selling"]:
continue continue
@ -133,7 +138,7 @@ class Agora(object):
if reference not in current_trades: if reference not in current_trades:
current_trades.append(reference) current_trades.append(reference)
# Let us know there is a new trade # 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 # Note that we have seen this reference
self.last_dash.add(reference) self.last_dash.add(reference)