Skip to content

Commit

Permalink
Use an isinstance check for displaying roles in userinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
LightSage committed Sep 14, 2024
1 parent 4409971 commit 384e63d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lightning/cogs/info/discord_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 384e63d

Please sign in to comment.