aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ben Soyka <[email protected]>2021-12-01 21:16:49 -0700
committerGravatar Ben Soyka <[email protected]>2021-12-01 21:16:49 -0700
commit4959f085537421814159734070b74dadd566501f (patch)
tree8e00dc594e987498d731425023f32c5991cf3f60
parentMake self_placement_name keyword-only in .aoc lb (diff)
Strip quotes from start/end of the username for .aoc lb
-rw-r--r--bot/exts/events/advent_of_code/_cog.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/events/advent_of_code/_cog.py b/bot/exts/events/advent_of_code/_cog.py
index 900c3469..c6225356 100644
--- a/bot/exts/events/advent_of_code/_cog.py
+++ b/bot/exts/events/advent_of_code/_cog.py
@@ -229,6 +229,10 @@ class AdventOfCode(commands.Cog):
Additionally you can specify a `self_placement_name`
that will append the specified profile's personal stats to the top of the leaderboard
"""
+ # Strip quotes from the self placement name if needed (e.g. "My Name" -> My Name)
+ if self_placement_name and self_placement_name[0] == self_placement_name[-1] == '"':
+ self_placement_name = self_placement_name[1:-1]
+
async with ctx.typing():
try:
leaderboard = await _helpers.fetch_leaderboard(self_placement_name=self_placement_name)