diff options
| author | 2021-08-14 09:53:53 +0100 | |
|---|---|---|
| committer | 2021-08-22 20:24:00 +0100 | |
| commit | 36d0ea88dc4ac071778355de948e7f06420f1c41 (patch) | |
| tree | 6854abf5382e98cf7b262231f743098c3d72ce89 | |
| parent | Remove redundant getattr protection (diff) | |
Attempt to get user from DB when discord.Object passed to search_user
| -rw-r--r-- | bot/exts/moderation/infraction/management.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bot/exts/moderation/infraction/management.py b/bot/exts/moderation/infraction/management.py index 725e8798c..b05b051cc 100644 --- a/bot/exts/moderation/infraction/management.py +++ b/bot/exts/moderation/infraction/management.py @@ -219,9 +219,13 @@ class ModManagement(commands.Cog): ) if isinstance(user, (discord.Member, discord.User)): - user_str = escape_markdown(user.name) + user.discriminator + user_str = escape_markdown(str(user)) else: - user_str = str(user.id) + if infraction_list: + user = infraction_list[0]["user"] + user_str = escape_markdown(user["name"]) + f"#{user['discriminator']:04}" + else: + user_str = str(user.id) embed = discord.Embed( title=f"Infractions for {user_str} ({len(infraction_list)} total)", |