Fix Ogre parsing

This commit is contained in:
scoobybejesus 2021-08-24 17:27:13 -04:00 committed by GitHub
parent 88c8827552
commit 42e7fffc49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -404,13 +404,19 @@ def ogre(bot, trigger):
try:
r = requests.get(ogreurl)
j = r.json()
except:
bot.say("Error retrieving data from Ogre")
last = 0.0
vol = 0.0
try:
for i in j:
if pair == i.keys()[0]:
for key in i:
if pair == key:
last=float(i[pair]['price'])
vol=float(i[pair]['volume'])
bot.say("{0} on Tradeogre at {1:.8f} BTC on {2:.3f} BTC volume".format(pair, last, vol))
except:
bot.say("Error retrieving data from Ogre")
bot.say("Error parsing data from Ogre")
@sopel.module.commands('trex', 'bittrex')