Repository: python-discord/sir-lancebot
Issue: Better handling of AoC usernames with spaces

## Description
<!-- Describe the bug you've found -->
Sir Lancebot doesn't handle Advent of Code usernames with spaces very well.

## Steps to Reproduce
<!-- Detail the exact list of steps to be able to encounter the bug -->
Run `.aoc lb` followed by any AoC username with at least one space.

## Expected Behaviour
<!-- Outline what you expect to occur, include screenshots if relevant -->
The bot would handle the arguments together as a username.

## Actual Behaviour
<!-- Outline what occurs instead of the expected behaviour, include screenshots if relevant -->
The bot uses the first word and ignores the rest, unless the username is wrapped in quotes.

## Known Impacted Platforms
<!-- Replace [ ] with [x] to mark items -->

- [x] Web
- [x] Desktop
- [x] Android App
- [x] iOS App

## Possible Solutions
<!-- Detail any solutions you might have in mind to be able to resolve the bug -->
Make `self_placement_name` a [keyword-only argument](https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html#keyword-only-arguments) to use the entire input.

## Would you like to implement a fix?

***Note: For high-priority or critical bugs, fixes may be implemented by staff.***
<!-- Replace [ ] with [x] with your choice -->

- [x] I'd like to implement the bug fix
- [ ] Anyone can implement the bug fix


Changed files:
bot/exts/events/advent_of_code/_cog.py

diff --git a/bot/exts/events/advent_of_code/_cog.py b/bot/exts/events/advent_of_code/_cog.py
index 65a16fdd..3ad24b3b 100644
--- a/bot/exts/events/advent_of_code/_cog.py
+++ b/bot/exts/events/advent_of_code/_cog.py
@@ -220,20 +220,23 @@ class AdventOfCode(commands.Cog):
         brief="Get a snapshot of the PyDis private AoC leaderboard",
     )
     @whitelist_override(channels=AOC_WHITELIST_RESTRICTED)
-    async def aoc_leaderboard(
-            self,
-            ctx: commands.Context,
-            self_placement_name: Optional[str] = None,
-    ) -> None:
+    async def aoc_leaderboard(self, ctx: commands.Context, *, aoc_name: Optional[str] = None) -> None:
         """
         Get the current top scorers of the Python Discord Leaderboard.
 
-        Additionally you can specify a `self_placement_name`
-        that will append the specified profile's personal stats to the top of the leaderboard
+        Additionally you can specify an `aoc_name` that will append the
+        specified profile's personal stats to the top of the leaderboard
         """
+        # Strip quotes from the AoC username if needed (e.g. "My Name" -> My Name)
+        # This is to keep compatibility with those already used to wrapping the AoC name in quotes
+        # Note: only strips one layer of quotes to allow names with quotes at the start and end
+        #      e.g. ""My Name"" -> "My Name"
+        if aoc_name and aoc_name.startswith('"') and aoc_name.endswith('"'):
+            aoc_name = aoc_name[1:-1]
+
         async with ctx.typing():
             try:
-                leaderboard = await _helpers.fetch_leaderboard(self_placement_name=self_placement_name)
+                leaderboard = await _helpers.fetch_leaderboard(self_placement_name=aoc_name)
             except _helpers.FetchingLeaderboardFailedError:
                 await ctx.send(":x: Unable to fetch leaderboard!")
                 return
@@ -241,10 +244,10 @@ class AdventOfCode(commands.Cog):
         number_of_participants = leaderboard["number_of_participants"]
 
         top_count = min(AocConfig.leaderboard_displayed_members, number_of_participants)
-        self_placement_header = "(and your personal stats compared to the top 10)" if self_placement_name else ""
+        self_placement_header = "(and your personal stats compared to the top 10)" if aoc_name else ""
         header = f"Here's our current top {top_count}{self_placement_header}! {Emojis.christmas_tree * 3}"
         table = "```\\n" \\
-                f"{leaderboard['placement_leaderboard'] if self_placement_name else leaderboard['top_leaderboard']}" \\
+                f"{leaderboard['placement_leaderboard'] if aoc_name else leaderboard['top_leaderboard']}" \\
                 "\\n```"
         info_embed = _helpers.get_summary_embed(leaderboard)