From ab05ba5b607487133524da9756c802d36e5e3d01 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Sat, 28 Jul 2018 13:08:20 -0700 Subject: [PATCH] fix ogre --- price.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/price.py b/price.py index 484fc67..e9dc42c 100644 --- a/price.py +++ b/price.py @@ -285,16 +285,16 @@ def trex(bot, trigger): @sopel.module.commands('tradeogre', 'ogre') def ogre(bot, trigger): if not trigger.group(2): - coin = 'XMR' + pair = 'BTC-XMR' else: - coin = trigger.group(2).upper() + coin = 'BTC-'+trigger.group(2).upper() try: r = requests.get(ogreurl) j = r.json() for i in j: - if "BTC-"+coin == i.key(): - last=float(i['price']) - vol=float(i['volume']) + if pair == i.keys(): + last=float(i[pair]['price']) + vol=float(i[pair]['volume']) bot.say("Tradeogre at {0:.8f} BTC; on {1:.3f} BTC volume".format(last, vol)) except: bot.say("Error retrieving data from Ogre")