Skip to content

Commit

Permalink
Fix for user obj not having joined_at
Browse files Browse the repository at this point in the history
  • Loading branch information
MattBSG committed Jun 25, 2024
1 parent e1e7eec commit 01110d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,12 @@ async def _info(self, interaction: discord.Interaction, user: discord.User):
embed.set_author(name=f'{str(user)} | {user.id}', icon_url=user.display_avatar.url)
embed.set_thumbnail(url=user.display_avatar.url)
embed.add_field(name='Messages', value=str(msgCount), inline=True)
if inServer:
if inServer and isinstance(user, discord.Member):
embed.add_field(name='Join date', value=f'<t:{int(user.joined_at.timestamp())}:f>', inline=True)

elif inServer and dbUser['leaves']:
embed.add_field(name='Left server', value=f'<t:{int(max(dbUser['leaves']))}:f>', inline=True)

roleList = []
if inServer:
for role in reversed(user.roles):
Expand Down

0 comments on commit 01110d5

Please sign in to comment.