From 9de71906e74ee2d13f0e125bb52cf505fa6deb88 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 11 Feb 2024 16:40:48 +0000 Subject: Output user alts in user command when ran in mod channels --- bot/exts/info/information.py | 7 +++++++ 1 file changed, 7 insertions(+) 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( -- cgit v1.2.3