Skip to content

Commit

Permalink
Fix display when admin who gave/removed XP left server
Browse files Browse the repository at this point in the history
  • Loading branch information
tiltowait committed Sep 23, 2023
1 parent fb533ca commit fff0f1b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions inconnu/experience/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ async def __get_chunks(ctx, character):

exp = event["amount"]
reason = event["reason"]
admin_id = event["admin"]
scope = event["event"].split("_")[-1]

# Get the admin discord.Member. Try the cache first.
if (admin := ctx.guild.get_member(admin_id)) is None:
admin = await ctx.guild.fetch_member(admin_id)
# Construct the admin mention rather than fetching it
admin = f"<@{event['admin']}>"

text = f"{index + 1}. **{exp:+} {scope}: {reason}** - {admin.mention}{date}"
text = f"{index + 1}. **{exp:+} {scope}: {reason}** - {admin}{date}"

chunker.add_line(text)

Expand Down

0 comments on commit fff0f1b

Please sign in to comment.