From ef94b6337413ab44913af880d4caa5cc29de6fef Mon Sep 17 00:00:00 2001 From: TanyaPegasus Date: Sun, 3 Sep 2023 23:25:47 +1000 Subject: [PATCH] corrected issue where member variable was accessed before it had been declared --- dictator/cogs/informational.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dictator/cogs/informational.py b/dictator/cogs/informational.py index c96477e..b2050dd 100644 --- a/dictator/cogs/informational.py +++ b/dictator/cogs/informational.py @@ -49,6 +49,8 @@ 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) @@ -56,8 +58,6 @@ async def info(self, interaction: discord.Interaction, user: discord.User) -> No 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