diff options
author | 2023-12-13 15:46:21 +0000 | |
---|---|---|
committer | 2024-05-23 21:50:16 +0100 | |
commit | 98c7a2c98a8e00804f369969b4af4316c3ce1e07 (patch) | |
tree | cc70f369c80d12b6cc37bd1ddd5dd6e89dc9519f | |
parent | Add a cog to manage tracking a user's alt accounts (diff) |
Indicate if the user has alts when seaching for their infractions
-rw-r--r-- | bot/exts/moderation/infraction/management.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/exts/moderation/infraction/management.py b/bot/exts/moderation/infraction/management.py index ac228d8a2..a3b18002b 100644 --- a/bot/exts/moderation/infraction/management.py +++ b/bot/exts/moderation/infraction/management.py @@ -1,3 +1,4 @@ +import gettext import re import textwrap import typing as t @@ -313,6 +314,10 @@ class ModManagement(commands.Cog): ) # Manually form mention from ID as discord.Object doesn't have a `.mention` attr prefix = f"<@{user.id}> - {user.id}" + # If the user has alts show in the prefix + if infraction_list and (alts := infraction_list[0]["user"]["alts"]): + prefix += f" ({len(alts)} associated {gettext.ngettext('account', 'accounts', len(alts))})" + await self.send_infraction_list(ctx, embed, infraction_list, prefix, ("user",)) @infraction_search_group.command(name="reason", aliases=("match", "regex", "re")) |