1
0
Fork 0
mirror of synced 2024-06-29 03:30:57 +12:00

Corrected syntax errors

This commit is contained in:
phxntxm 2016-07-28 18:15:02 -05:00
parent 5259b3ec3d
commit 187ee31fc8
3 changed files with 10 additions and 11 deletions

View file

@ -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)

View file

@ -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):

View file

@ -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))