Corrected error where only the author was searched instead of the user
This commit is contained in:
parent
d137884b5b
commit
a85082a876
1 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ class Overwatch:
|
||||||
Provide a hero after the member to get stats for that specific hero"""
|
Provide a hero after the member to get stats for that specific hero"""
|
||||||
if user is None:
|
if user is None:
|
||||||
user = ctx.message.author
|
user = ctx.message.author
|
||||||
bt = config.getContent('overwatch').get(ctx.message.author.id)
|
bt = config.getContent('overwatch').get(user.id)
|
||||||
|
|
||||||
if bt is None:
|
if bt is None:
|
||||||
await self.bot.say("I do not have this user's battletag saved!")
|
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:
|
with aiohttp.ClientSession(headers={"User-Agent": "Bonfire/1.0.0"}) as s:
|
||||||
async with s.get(url) as r:
|
async with s.get(url) as r:
|
||||||
result = await r.text()
|
result = await r.text()
|
||||||
msg = json.loads(result)['msg']
|
msg = json.loads(result).get('msg')
|
||||||
if msg == 'hero data not found':
|
if msg == 'hero data not found':
|
||||||
fmt = "{} has not used the hero {} before!".format(user.name, hero.title())
|
fmt = "{} has not used the hero {} before!".format(user.name, hero.title())
|
||||||
await self.bot.say(fmt)
|
await self.bot.say(fmt)
|
||||||
|
|
Loading…
Reference in a new issue