From 384e63d4bb226b353a3cc91d6600ee641202d909 Mon Sep 17 00:00:00 2001 From: LightSage Date: Sat, 14 Sep 2024 09:12:54 -0500 Subject: [PATCH] Use an isinstance check for displaying roles in userinfo --- lightning/cogs/info/discord_meta.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning/cogs/info/discord_meta.py b/lightning/cogs/info/discord_meta.py index ae2e3d46..479c73a8 100644 --- a/lightning/cogs/info/discord_meta.py +++ b/lightning/cogs/info/discord_meta.py @@ -76,14 +76,14 @@ async def userinfo(self, ctx: LightningContext, *, else: desc.append(f"**Shared Servers**: {len(member.mutual_guilds)}") - if not isinstance(member, discord.Member): + if not isinstance(member, discord.Member) and ctx.guild is not None: embed.set_footer(text='This user is not in this server.') if hasattr(member, 'joined_at'): desc.append(f"**Joined**: {discord.utils.format_dt(member.joined_at)} " f"({natural_timedelta(member.joined_at, accuracy=3)})") - if hasattr(member, 'roles'): + if isinstance(member, discord.Member): if roles := [x.mention for x in member.roles if not x.is_default()]: revrole = reversed(roles[:10]) if len(roles) > 10: