diff options
author | 2022-01-09 23:33:34 +0000 | |
---|---|---|
committer | 2022-01-09 23:33:34 +0000 | |
commit | 09e8ad3fbf27ff9bb9e0a249260a8cff878c2b51 (patch) | |
tree | 0aad3f68e725882e69944df300b16bea206488a4 /bot | |
parent | Merge pull request #1006 from python-discord/fix-single-quotes (diff) | |
parent | Fix aoc join in date logic (diff) |
Merge pull request #1008 from python-discord/fix-aoc-join-logic
Diffstat (limited to 'bot')
-rw-r--r-- | bot/exts/events/advent_of_code/_cog.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/exts/events/advent_of_code/_cog.py b/bot/exts/events/advent_of_code/_cog.py index a5410871..01161f26 100644 --- a/bot/exts/events/advent_of_code/_cog.py +++ b/bot/exts/events/advent_of_code/_cog.py @@ -187,9 +187,10 @@ class AdventOfCode(commands.Cog): async def join_leaderboard(self, ctx: commands.Context) -> None: """DM the user the information for joining the Python Discord leaderboard.""" current_date = datetime.now() - if ( - current_date.month not in (Month.NOVEMBER, Month.DECEMBER) and current_date.year != AocConfig.year or - current_date.month != Month.JANUARY and current_date.year != AocConfig.year + 1 + allowed_months = (Month.NOVEMBER.value, Month.DECEMBER.value) + if not ( + current_date.month in allowed_months and current_date.year == AocConfig.year or + current_date.month == Month.JANUARY.value and current_date.year == AocConfig.year + 1 ): # Only allow joining the leaderboard in the run up to AOC and the January following. await ctx.send(f"The Python Discord leaderboard for {current_date.year} is not yet available!") |