Skip to content

Commit

Permalink
clearer var name
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysquid committed Apr 23, 2024
1 parent cf04fb5 commit 40a8f39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cogs/code_golf.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,18 @@ async def leaderboard(self, ctx: cmds.Context):
size, count, name = item
mention = name

participant = discord.utils.get(ctx.guild.members, name=name)
mention = participant.mention if participant else name
member = discord.utils.get(ctx.guild.members, name=name)
mention = member.mention if member else name
if name == CodeGolf.REFERENCE_IMPLEM:
mention = ctx.guild.default_role
bureau = discord.utils.get(ctx.guild.roles, id=ids.BUREAU)

if participant and bureau in participant.roles:
if member and bureau in member.roles:
mention = f"~~{mention}~~"

line = f"{i}. {mention} : {size} bytes ({count} challenge{'s' if count > 1 else ''})"

if participant and bureau in participant.roles:
if member and bureau in member.roles:
line = f"{line} {bureau.mention}"

text.append(line)
Expand Down

0 comments on commit 40a8f39

Please sign in to comment.