diff --git a/cogs/interaction.py b/cogs/interaction.py index a00d78c..685a32f 100644 --- a/cogs/interaction.py +++ b/cogs/interaction.py @@ -187,7 +187,7 @@ class Interaction: booper_boops[boopee.id] = amount boops[ctx.message.author.id] = booper_boops - config.saveContent('boops', boops): + config.saveContent('boops', boops) fmt = "{0.mention} has just booped you {1.mention}! That's {2} times now!" await self.bot.say(fmt.format(booper, boopee, amount)) await self.bot.delete_message(ctx.message) diff --git a/cogs/overwatch.py b/cogs/overwatch.py index faac828..fb62844 100644 --- a/cogs/overwatch.py +++ b/cogs/overwatch.py @@ -29,7 +29,7 @@ class Overwatch: @ow.command(name="stats", pass_context=True, no_pm=True) @checks.customPermsOrRole("send_messages") - async def ow_stats(self, ctx, user: discord.Member=None, hero: str=""): + async def ow_stats(self, ctx, user: discord.Member = None, hero: str = ""): """Prints out a basic overview of a member's stats Provide a hero after the member to get stats for that specific hero""" if user is None: @@ -41,12 +41,11 @@ class Overwatch: return await self.bot.say("Searching profile information....") - if hero == "": with aiohttp.ClientSession() as s: async with s.get(base_url + "{}/stats/general".format(bt)) as r: result = await r.text() - + data = json.loads(result) fmt = "\n".join("{}: {}".format(i, r) for i, r in data['game_stats'].items() if i in check_g_stats) fmt += "\n" @@ -65,9 +64,9 @@ class Overwatch: fmt = "{} is not an actual hero!".format(hero.title()) await self.bot.say(fmt) return - result = await r.text() + result = await r.text() data = json.loads(result) - + fmt = "\n".join("{}: {}".format(i, r) for i, r in data['general_stats'].items() if i in check_g_stats) fmt += "\n" fmt += "\n".join("{}: {}".format(i, r) for i, r in data['hero_stats'].items()) @@ -81,14 +80,14 @@ class Overwatch: bt = bt.replace("#", "-") await self.bot.say("Looking up your profile information....") url = base_url + "{}/stats/general".format(bt) - + with aiohttp.ClientSession() as s: async with s.get(url) as r: if not r.status == 200: await self.bot.say("Profile does not exist! Battletags are picky, " "format needs to be `user#xxxx`. Capitalization matters") return - + ow = config.getContent('overwatch') ow[ctx.message.author.id] = bt if config.saveContent('overwatch', ow): diff --git a/cogs/twitch.py b/cogs/twitch.py index cf843d0..7947bd0 100644 --- a/cogs/twitch.py +++ b/cogs/twitch.py @@ -102,7 +102,7 @@ class Twitch: else: twitch[ctx.message.author.id] = {'twitch_url': url, 'server_id': ctx.message.server.id, 'notifications_on': 1, 'live': 0} - config.saveContent('twitch', twitch): + config.saveContent('twitch', twitch) await self.bot.say("I have just saved your twitch url {}".format(ctx.message.author.mention)) @twitch.command(name='remove', aliases=['delete'], pass_context=True, no_pm=True) @@ -112,7 +112,7 @@ class Twitch: twitch = config.getContent('twitch') if twitch.get(ctx.message.author.id) is not None: del twitch[ctx.message.author.id] - config.saveContent('twitch', twitch): + config.saveContent('twitch', twitch) await self.bot.say("I am no longer saving your twitch URL {}".format(ctx.message.author.mention)) else: await self.bot.say( @@ -140,7 +140,7 @@ class Twitch: ctx.message.author.mention)) else: twitch[ctx.message.author.id]['notifications_on'] = 1 - if config.saveContent('twitch', twitch): + config.saveContent('twitch', twitch) await self.bot.say("I will notify if you go live {}, you'll get a bajillion followers I promise c:".format( ctx.message.author.mention))