From a85082a876db9763f0511c60615f4746b1c88501 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Fri, 5 Aug 2016 10:23:59 -0500 Subject: [PATCH] Corrected error where only the author was searched instead of the user --- cogs/overwatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/overwatch.py b/cogs/overwatch.py index fbfc5ef..e0c68f3 100644 --- a/cogs/overwatch.py +++ b/cogs/overwatch.py @@ -33,7 +33,7 @@ class Overwatch: Provide a hero after the member to get stats for that specific hero""" if user is None: user = ctx.message.author - bt = config.getContent('overwatch').get(ctx.message.author.id) + bt = config.getContent('overwatch').get(user.id) if bt is None: await self.bot.say("I do not have this user's battletag saved!") @@ -56,7 +56,7 @@ class Overwatch: with aiohttp.ClientSession(headers={"User-Agent": "Bonfire/1.0.0"}) as s: async with s.get(url) as r: result = await r.text() - msg = json.loads(result)['msg'] + msg = json.loads(result).get('msg') if msg == 'hero data not found': fmt = "{} has not used the hero {} before!".format(user.name, hero.title()) await self.bot.say(fmt)