Skip to content

Commit

Permalink
Fix another bug where db query was getting arguments in the wrong order.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachaa-Thanasius committed Jul 22, 2024
1 parent 1277adc commit 2bcddf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exts/snowball/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def upsert_record(
member_stmt = (
"INSERT INTO members (guild_id, user_id) VALUES ($1, $2) ON CONFLICT (guild_id, user_id) DO NOTHING;"
)
await conn.execute(member_stmt, member.id, member.guild.id)
await conn.execute(member_stmt, member.guild.id, member.id)

snowball_stmt = """\
INSERT INTO snowball_stats (user_id, guild_id, hits, misses, kos, stock)
Expand All @@ -78,7 +78,7 @@ async def upsert_record(
stock = snowball_stats.stock + $7
RETURNING *;
"""
args = member.id, member.guild.id, hits, misses, kos, max(stock, 0), stock
args = (member.id, member.guild.id, hits, misses, kos, max(stock, 0), stock)
return cls.from_record(await conn.fetchrow(snowball_stmt, *args))


Expand Down

0 comments on commit 2bcddf9

Please sign in to comment.