Skip to content

Commit

Permalink
Work/Daily Cooldown Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoz committed Oct 14, 2024
1 parent 8a0c6cc commit 1d7583c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cogs/economy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ async def work(self, interaction: nextcord.Interaction):
if user_id in self.work_cooldown and now < self.work_cooldown[user_id] + timedelta(seconds=self.work_timer):
await interaction.response.send_message(t("EconomyCog", "work.cooldown_message"))
return
self.work_cooldown[user_id] = now
user_name = interaction.user.display_name
user_name, points = await get_points(user_id, user_name)
base_points = random.randint(self.work_min, self.work_max)
Expand All @@ -233,7 +234,6 @@ async def work(self, interaction: nextcord.Interaction):
embed = nextcord.Embed(
title=t("EconomyCog", "work.title"), description=desc_text, color=nextcord.Color.blurple())
await interaction.response.send_message(embed=embed)
self.work_cooldown[user_id] = now
except Exception as e:
await interaction.response.send_message(f"Unexpected error: {e}")

Expand All @@ -252,6 +252,7 @@ async def daily(self, interaction: nextcord.Interaction):
remaining_time = "{}h {}m".format(int(hours), int(minutes))
await interaction.response.send_message(t("EconomyCog", "daily.cooldown_message").format(remaining_time=remaining_time))
return
self.daily_cooldown[user_id] = now
user_name = interaction.user.display_name
user_name, points = await get_points(user_id, user_name)
base_points = self.daily_reward
Expand All @@ -261,7 +262,6 @@ async def daily(self, interaction: nextcord.Interaction):
embed = nextcord.Embed(
title=t("EconomyCog", "daily.title"), description=t("EconomyCog", "daily.claimed").format(earned_points=earned_points, currency=self.currency), color=nextcord.Color.blurple())
await interaction.response.send_message(embed=embed)
self.daily_cooldown[user_id] = now
except Exception as e:
await interaction.response.send_message(f"Unexpected error: {e}")

Expand Down

0 comments on commit 1d7583c

Please sign in to comment.