Skip to content

Commit

Permalink
❌ Fix dumb error
Browse files Browse the repository at this point in the history
  • Loading branch information
tookender committed Sep 15, 2024
1 parent 3b835b6 commit 526599d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extensions/economy/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def callback(self, interaction: Interaction):
class JobCog(EconomyBase):
@commands.hybrid_command(description="Get a job or claim your passive income!")
async def job(self, ctx):
user_job = await self.bot.pool.fetchval("SELECT job FROM economy WHERE user_id = $1", ctx.user.id)
user_job = await self.bot.pool.fetchval("SELECT job FROM economy WHERE user_id = $1", ctx.author.id)

if not user_job:
await self.send_embed(ctx, text="You don't have a job yet! Please choose one from the dropdown below.", view=JobSelection(self.bot, ctx))
Expand All @@ -79,7 +79,7 @@ async def job(self, ctx):

async def claim_income(self, ctx, user_job):
# Fetch the last time user claimed their income
last_claim = await self.bot.pool.fetchval("SELECT last_claim FROM economy WHERE user_id = $1", ctx.user.id)
last_claim = await self.bot.pool.fetchval("SELECT last_claim FROM economy WHERE user_id = $1", ctx.author.id)

if last_claim is None:
last_claim = datetime.datetime.now(datetime.timezone.utc)
Expand All @@ -94,7 +94,7 @@ async def claim_income(self, ctx, user_job):
hourly_pay = jobs_data[user_job]["pay"]
total_income = int(hours_passed) * hourly_pay

await self.bot.pool.execute("UPDATE economy SET last_claim = $1 WHERE user_id = $2", now, ctx.user.id)
await self.bot.pool.execute("UPDATE economy SET last_claim = $1 WHERE user_id = $2", now, ctx.author.id)
await add_money(self.bot, ctx.author.id, total_income)

await self.send_embed(ctx, text=f"You've claimed ${total_income} from your job as a {user_job.capitalize()}. Keep working hard!", return_embed=False)

0 comments on commit 526599d

Please sign in to comment.