diff options
| author | 2019-04-21 12:10:13 +1000 | |
|---|---|---|
| committer | 2019-04-21 12:10:13 +1000 | |
| commit | c2776d04222452523c4c2c49e227b02d79a5b5b7 (patch) | |
| tree | 1eb1dd64352a7e24bd0193319c3a29802a81a344 | |
| parent | Add return annotations. (diff) | |
Fix consistencies, address @fiskenslakt's comments.
| -rw-r--r-- | bot/seasons/easter/egg_hunt/cog.py | 19 | ||||
| -rw-r--r-- | bot/seasons/easter/egg_hunt/constants.py | 2 | 
2 files changed, 10 insertions, 11 deletions
| diff --git a/bot/seasons/easter/egg_hunt/cog.py b/bot/seasons/easter/egg_hunt/cog.py index c8a314a1..7c6214d2 100644 --- a/bot/seasons/easter/egg_hunt/cog.py +++ b/bot/seasons/easter/egg_hunt/cog.py @@ -218,7 +218,7 @@ class SuperEggMessage(EggMessage):          if white == blurple:              log.debug("Tied SuperEgg Result.")              team = None -            score = score / 2 +            score /= 2          elif white > blurple:              team = Roles.white          else: @@ -235,7 +235,7 @@ class SuperEggMessage(EggMessage):                  continue              role = get_team_role(user)              if not role: -                print('issue') +                print("issue")              user_score = 1 if user != self.first else user_bonus              c.execute(self.add_user_score_sql(user.id, self.teams[role], user_score)) @@ -284,7 +284,7 @@ class SuperEggMessage(EggMessage):  class EggHunt(commands.Cog): -    """Easter Egg Hunt Event""" +    """Easter Egg Hunt Event."""      def __init__(self):          self.event_channel = GUILD.get_channel(Channels.seasonalbot_chat) @@ -310,7 +310,7 @@ class EggHunt(commands.Cog):              now = self.current_timestamp()              if now > EggHuntSettings.end_time: -                log.debug(f"Hunt ended. Ending task.") +                log.debug("Hunt ended. Ending task.")                  break              if now < EggHuntSettings.start_time: @@ -340,7 +340,6 @@ class EggHunt(commands.Cog):              db.close()              if not count: -                log.debug(f"test")                  next_drop = random.randrange(now, next_window)                  log.debug(f"Sleeping until next super egg drop: {next_drop}.")                  await asyncio.sleep(next_drop) @@ -362,11 +361,11 @@ class EggHunt(commands.Cog):                      colour=colour                  )                  embed.set_thumbnail(url=egg.url) -                embed.set_footer(text=f"Finishing in 5 minutes.") +                embed.set_footer(text="Finishing in 5 minutes.")                  msg = await self.event_channel.send(embed=embed)                  await SuperEggMessage(msg, egg, current_window).start() -            log.debug(f"Sleeping until next window.") +            log.debug("Sleeping until next window.")              next_loop = max(next_window - self.current_timestamp(), 0)              await asyncio.sleep(next_loop) @@ -452,11 +451,11 @@ class EggHunt(commands.Cog):              team = team.capitalize()              score = f"{score}pts"              output.append(f"{rank:>2}. {score:>{scr_len+3}} - {user} ({team})") -        user_board = '\n'.join(output) +        user_board = "\n".join(output)          output = []          for team, score in team_result:              output.append(f"{team:<7}: {score}") -        team_board = '\n'.join(output) +        team_board = "\n".join(output)          embed = discord.Embed(              title="Egg Hunt Leaderboards",              description=f"**Teams**\n```\n{team_board}\n```\n" @@ -505,7 +504,7 @@ class EggHunt(commands.Cog):          c = db.cursor()          c.execute("DELETE FROM super_eggs;")          c.execute("DELETE FROM user_scores;") -        c.execute(f"UPDATE team_scores SET team_score=0") +        c.execute("UPDATE team_scores SET team_score=0")          db.commit()          db.close()          await ctx.send("Database successfully cleared.") diff --git a/bot/seasons/easter/egg_hunt/constants.py b/bot/seasons/easter/egg_hunt/constants.py index 592235b2..3f3c3bbe 100644 --- a/bot/seasons/easter/egg_hunt/constants.py +++ b/bot/seasons/easter/egg_hunt/constants.py @@ -10,7 +10,7 @@ GUILD = bot.get_guild(Client.guild)  class EggHuntSettings:      start_time = int(os.environ["HUNT_START"]) -    end_time = start_time + 172800 +    end_time = start_time + 172800  # 48 hrs later      windows = os.environ.get("HUNT_WINDOWS").split(',') or []      allowed_channels = [          Channels.seasonalbot_chat, | 
