Skip to content

Commit bdb5953

Browse files
style: fix styling issues
- whitespace around ifs - update quotes, remove typehint - remove unnecessary type arg
1 parent e189a03 commit bdb5953

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

bot/exts/advent_of_code/_cog.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,11 @@ async def aoc_leaderboard(self, ctx: commands.Context, *, aoc_name: str | None =
385385
aoc_name = aoc_name[1:-1]
386386

387387
# Check if an advent of code account is linked in the Redis Cache if aoc_name is not given
388-
is_explict_name: bool = bool(aoc_name)
388+
is_explict_name = bool(aoc_name)
389389
if (aoc_cache_name := await _caches.account_links.get(ctx.author.id)) and aoc_name is None:
390390
aoc_name = aoc_cache_name
391391

392-
name_not_found: bool = False
392+
name_not_found = False
393393
async with ctx.typing():
394394
try:
395395
try:
@@ -407,21 +407,24 @@ async def aoc_leaderboard(self, ctx: commands.Context, *, aoc_name: str | None =
407407
return
408408

409409
number_of_participants = leaderboard["number_of_participants"]
410-
411410
top_count = min(AocConfig.leaderboard_displayed_members, number_of_participants)
411+
412412
header = ""
413413
if name_not_found:
414414
header += (
415415
f"\n:x: Your linked Advent of Code account '{aoc_cache_name}' was not found in the leaderboard."
416416
" Showing top leaderboard only. "
417417
"Wait up to 30 minutes after joining the leaderboard for your stats to appear.\n\n"
418418
)
419+
419420
header += f"Here's our current top {top_count}"
421+
420422
if aoc_name:
421423
header += (
422424
f" (and {f"the requested user ({Emojis.orange_diamond})" if is_explict_name else 'your'}"
423425
f" personal stats compared to the top {top_count})"
424426
)
427+
425428
header += f"! {Emojis.christmas_tree * 3}"
426429
table = (
427430
f"```\n{leaderboard['placement_leaderboard'] if aoc_name else leaderboard['top_leaderboard']} \n```"

bot/exts/advent_of_code/_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _format_leaderboard(
197197
for rank, data in enumerate(leaderboard.values(), start=1):
198198
if self_placement_name and data["name"].lower() == self_placement_name.lower():
199199
if use_you_for_placement:
200-
name = f"(You) {data['name']}"
200+
name = f"(You) {data["name"]}"
201201
else:
202202
name = f"({Emojis.orange_diamond}) {data['name']}"
203203
leaderboard_lines.insert(

0 commit comments

Comments
 (0)