Corrected syntax errors
This commit is contained in:
parent
5259b3ec3d
commit
187ee31fc8
3 changed files with 10 additions and 11 deletions
|
@ -187,7 +187,7 @@ class Interaction:
|
||||||
booper_boops[boopee.id] = amount
|
booper_boops[boopee.id] = amount
|
||||||
boops[ctx.message.author.id] = booper_boops
|
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!"
|
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.say(fmt.format(booper, boopee, amount))
|
||||||
await self.bot.delete_message(ctx.message)
|
await self.bot.delete_message(ctx.message)
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Overwatch:
|
||||||
|
|
||||||
@ow.command(name="stats", pass_context=True, no_pm=True)
|
@ow.command(name="stats", pass_context=True, no_pm=True)
|
||||||
@checks.customPermsOrRole("send_messages")
|
@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
|
"""Prints out a basic overview of a member's stats
|
||||||
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:
|
||||||
|
@ -41,12 +41,11 @@ class Overwatch:
|
||||||
return
|
return
|
||||||
await self.bot.say("Searching profile information....")
|
await self.bot.say("Searching profile information....")
|
||||||
|
|
||||||
|
|
||||||
if hero == "":
|
if hero == "":
|
||||||
with aiohttp.ClientSession() as s:
|
with aiohttp.ClientSession() as s:
|
||||||
async with s.get(base_url + "{}/stats/general".format(bt)) as r:
|
async with s.get(base_url + "{}/stats/general".format(bt)) as r:
|
||||||
result = await r.text()
|
result = await r.text()
|
||||||
|
|
||||||
data = json.loads(result)
|
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".join("{}: {}".format(i, r) for i, r in data['game_stats'].items() if i in check_g_stats)
|
||||||
fmt += "\n"
|
fmt += "\n"
|
||||||
|
@ -65,9 +64,9 @@ class Overwatch:
|
||||||
fmt = "{} is not an actual hero!".format(hero.title())
|
fmt = "{} is not an actual hero!".format(hero.title())
|
||||||
await self.bot.say(fmt)
|
await self.bot.say(fmt)
|
||||||
return
|
return
|
||||||
result = await r.text()
|
result = await r.text()
|
||||||
data = json.loads(result)
|
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".join("{}: {}".format(i, r) for i, r in data['general_stats'].items() if i in check_g_stats)
|
||||||
fmt += "\n"
|
fmt += "\n"
|
||||||
fmt += "\n".join("{}: {}".format(i, r) for i, r in data['hero_stats'].items())
|
fmt += "\n".join("{}: {}".format(i, r) for i, r in data['hero_stats'].items())
|
||||||
|
@ -81,14 +80,14 @@ class Overwatch:
|
||||||
bt = bt.replace("#", "-")
|
bt = bt.replace("#", "-")
|
||||||
await self.bot.say("Looking up your profile information....")
|
await self.bot.say("Looking up your profile information....")
|
||||||
url = base_url + "{}/stats/general".format(bt)
|
url = base_url + "{}/stats/general".format(bt)
|
||||||
|
|
||||||
with aiohttp.ClientSession() as s:
|
with aiohttp.ClientSession() as s:
|
||||||
async with s.get(url) as r:
|
async with s.get(url) as r:
|
||||||
if not r.status == 200:
|
if not r.status == 200:
|
||||||
await self.bot.say("Profile does not exist! Battletags are picky, "
|
await self.bot.say("Profile does not exist! Battletags are picky, "
|
||||||
"format needs to be `user#xxxx`. Capitalization matters")
|
"format needs to be `user#xxxx`. Capitalization matters")
|
||||||
return
|
return
|
||||||
|
|
||||||
ow = config.getContent('overwatch')
|
ow = config.getContent('overwatch')
|
||||||
ow[ctx.message.author.id] = bt
|
ow[ctx.message.author.id] = bt
|
||||||
if config.saveContent('overwatch', ow):
|
if config.saveContent('overwatch', ow):
|
||||||
|
|
|
@ -102,7 +102,7 @@ class Twitch:
|
||||||
else:
|
else:
|
||||||
twitch[ctx.message.author.id] = {'twitch_url': url, 'server_id': ctx.message.server.id,
|
twitch[ctx.message.author.id] = {'twitch_url': url, 'server_id': ctx.message.server.id,
|
||||||
'notifications_on': 1, 'live': 0}
|
'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))
|
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)
|
@twitch.command(name='remove', aliases=['delete'], pass_context=True, no_pm=True)
|
||||||
|
@ -112,7 +112,7 @@ class Twitch:
|
||||||
twitch = config.getContent('twitch')
|
twitch = config.getContent('twitch')
|
||||||
if twitch.get(ctx.message.author.id) is not None:
|
if twitch.get(ctx.message.author.id) is not None:
|
||||||
del twitch[ctx.message.author.id]
|
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))
|
await self.bot.say("I am no longer saving your twitch URL {}".format(ctx.message.author.mention))
|
||||||
else:
|
else:
|
||||||
await self.bot.say(
|
await self.bot.say(
|
||||||
|
@ -140,7 +140,7 @@ class Twitch:
|
||||||
ctx.message.author.mention))
|
ctx.message.author.mention))
|
||||||
else:
|
else:
|
||||||
twitch[ctx.message.author.id]['notifications_on'] = 1
|
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(
|
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))
|
ctx.message.author.mention))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue