aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-02-11 16:40:48 +0000
committerGravatar Chris Lovering <[email protected]>2024-05-23 21:50:16 +0100
commit9de71906e74ee2d13f0e125bb52cf505fa6deb88 (patch)
tree04507d851c27d3a88717b4ae85424cb09d855afa
parentNicely format error when editing alts where target user isn't an alt (diff)
Output user alts in user command when ran in mod channels
-rw-r--r--bot/exts/info/information.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py
index c04bf72a6..482b1efba 100644
--- a/bot/exts/info/information.py
+++ b/bot/exts/info/information.py
@@ -323,6 +323,7 @@ class Information(Cog):
if is_mod_channel(ctx.channel):
fields.append(await self.expanded_user_infraction_counts(user))
fields.append(await self.user_nomination_counts(user))
+ fields.append(await self.user_alt_count(user))
else:
fields.append(await self.basic_user_infraction_counts(user))
@@ -340,6 +341,12 @@ class Information(Cog):
return embed
+ async def user_alt_count(self, user: MemberOrUser) -> tuple[str, int | str]:
+ """Get the number oif alts for the given member."""
+ resp = await self.bot.api_client.get(f"bot/users/{user.id}")
+ return ("Associated accounts", len(resp["alts"]) or "No associated accounts")
+
+
async def basic_user_infraction_counts(self, user: MemberOrUser) -> tuple[str, str]:
"""Gets the total and active infraction counts for the given `member`."""
infractions = await self.bot.api_client.get(