Skip to content

Commit

Permalink
corrected issue where member variable was accessed before it had been…
Browse files Browse the repository at this point in the history
… declared
  • Loading branch information
TanyaPegasus authored and connorhsm committed Sep 6, 2023
1 parent d165d8b commit ef94b63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dictator/cogs/informational.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ async def info(self, interaction: discord.Interaction, user: discord.User) -> No
await interaction.followup.send(embed=embed, ephemeral=True)
return

member = interaction.guild.get_member(user.id)

# Time formatting
last_active = datetime.strptime(user_info[3], "%Y-%m-%d %H:%M:%S")
last_active = last_active.replace(tzinfo=timezone.utc)
now = discord.utils.utcnow()
difference = humanize.naturaltime(now - last_active)
joined_guild = humanize.naturaltime(now - member.joined_at)

member = interaction.guild.get_member(user.id)

# Form embed
embed = discord.Embed(
title=f"Results for the user '{user.name}':", colour=0xFFBB35
Expand Down

0 comments on commit ef94b63

Please sign in to comment.