Skip to content

Commit

Permalink
Indicate if the user has alts when seaching for their infractions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Dec 16, 2023
1 parent 9edee04 commit 49dac82
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bot/exts/moderation/infraction/management.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gettext
import re
import textwrap
import typing as t
Expand Down Expand Up @@ -311,6 +312,10 @@ async def search_user(self, ctx: Context, user: MemberOrUser | discord.Object) -
)
# 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"))
Expand Down

0 comments on commit 49dac82

Please sign in to comment.