aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-12-13 15:46:21 +0000
committerGravatar Chris Lovering <[email protected]>2024-05-23 21:50:16 +0100
commit98c7a2c98a8e00804f369969b4af4316c3ce1e07 (patch)
treecc70f369c80d12b6cc37bd1ddd5dd6e89dc9519f
parentAdd 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.py5
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"))