Skip to content

Commit 1a67d49

Browse files
authored
Merge pull request #165 from onerandomusername/qt/aoc-no-global
aoc: update global leaderboard command and wording for changes in 2025
2 parents 4dd43c6 + 9088a9f commit 1a67d49

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

bot/exts/advent_of_code/_cog.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ def __init__(self, bot: SirRobin):
5050
self.bot = bot
5151

5252
self._base_url = f"https://adventofcode.com/{AocConfig.year}"
53-
self.global_leaderboard_url = f"https://adventofcode.com/{AocConfig.year}/leaderboard"
5453

5554
self.about_aoc_filepath = Path("./bot/exts/advent_of_code/about.json")
5655
self.cached_about_aoc = self._build_about_embed()
56+
self.cached_no_global = self._build_no_global_leaderboard_embed()
5757

5858
self.scheduler = scheduling.Scheduler(self.__class__.__name__)
5959

@@ -434,22 +434,15 @@ async def aoc_leaderboard(self, ctx: commands.Context, *, aoc_name: str | None =
434434
await ctx.send(content=f"{header}\n\n{table}", embed=info_embed)
435435
return
436436

437-
@in_month(Month.DECEMBER, Month.JANUARY, Month.FEBRUARY)
438437
@adventofcode_group.command(
439438
name="global",
440439
aliases=("globalboard", "gb"),
441-
brief="Get a link to the global leaderboard",
440+
hidden=True, # Global leaderboard no longer exists
442441
)
443442
@in_whitelist(channels=AOC_WHITELIST_RESTRICTED, redirect=AOC_REDIRECT)
444443
async def aoc_global_leaderboard(self, ctx: commands.Context) -> None:
445-
"""Get a link to the global Advent of Code leaderboard."""
446-
url = self.global_leaderboard_url
447-
global_leaderboard = discord.Embed(
448-
title="Advent of Code — Global Leaderboard",
449-
description=f"You can find the global leaderboard [here]({url})."
450-
)
451-
global_leaderboard.set_thumbnail(url=_helpers.AOC_EMBED_THUMBNAIL)
452-
await ctx.send(embed=global_leaderboard)
444+
"""Send an embed notifying about the changes to the global leaderboard."""
445+
await ctx.send(embed=self.cached_no_global)
453446

454447
@in_month(Month.DECEMBER, Month.JANUARY, Month.FEBRUARY)
455448
@adventofcode_group.command(
@@ -511,11 +504,27 @@ def _build_about_embed(self) -> discord.Embed:
511504
title=self._base_url,
512505
colour=Colours.soft_green,
513506
url=self._base_url,
514-
timestamp=datetime.now(tz=UTC)
515507
)
516508
about_embed.set_author(name="Advent of Code", url=self._base_url)
517509
for field in embed_fields:
518510
about_embed.add_field(**field)
519511

520512
about_embed.set_footer(text="Last Updated")
521513
return about_embed
514+
515+
@staticmethod
516+
def _build_no_global_leaderboard_embed() -> discord.Embed:
517+
"""Build and return an embed notifying about the changes to the global leaderboard."""
518+
faq_link = "https://adventofcode.com/2025/about#faq_leaderboard"
519+
description = (
520+
f"To read about this change, head over to the [AoC FAQ]({faq_link}).\n\n"
521+
"You can still access the global leaderboards of previous years by heading over to "
522+
"https://adventofcode.com/events, choosing the desired year, and heading over to "
523+
"the `[Leaderboards]` tab."
524+
)
525+
526+
return discord.Embed(
527+
title="The global leaderboard is no more",
528+
description=description,
529+
colour=Colours.soft_red,
530+
)

bot/exts/advent_of_code/_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
AOC_EMBED_THUMBNAIL = (
4343
"https://raw.githubusercontent.com/python-discord"
44-
"/branding/main/seasonal/christmas/server_icons/festive_256.gif"
44+
"/branding/main/events/christmas/server_icons/festive_256.gif"
4545
)
4646

4747
# Create an easy constant for the EST timezone

bot/exts/advent_of_code/about.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
},
1717
{
1818
"name": "How does scoring work?",
19-
"value": "For the [global leaderboard](https://adventofcode.com/leaderboard), the first person to get a star first gets 100 points, the second person gets 99 points, and so on down to 1 point at 100th place.\n\nFor private leaderboards, the first person to get a star gets N points, where N is the number of people on the leaderboard. The second person to get the star gets N-1 points and so on and so forth.",
19+
"value": "AoC has private leaderboards. In these, the first person to get a star gets N points, where N is the number of people on the leaderboard. The second person to get the star gets N-1 points and so on and so forth. As the size of a leaderboard is limited, and Python Discord has many people who want to participate, we merge several leaderboards into one.\n\nTherefore, while you may see your standing in a specific leaderboard on the website, to get your total Python Discord standings you need to run the `&aoc lb` command.",
2020
"inline": false
2121
},
2222
{
23-
"name": "Join our private leaderboard!",
24-
"value": "Come join the Python Discord private leaderboard and compete against other people in the community! Get the join code using `.aoc join` and visit the [private leaderboard page](https://adventofcode.com/leaderboard/private) to join our leaderboard.",
23+
"name": "Join our leaderboard!",
24+
"value": "Come join the Python Discord leaderboard and compete against other people in the community! Get the join code using </aoc join:1312458389388787853> and visit the [leaderboard page](https://adventofcode.com/leaderboard/private) to join our leaderboard.",
2525
"inline": false
2626
}
2727
]

0 commit comments

Comments
 (0)