From 7e406f1a06b6d881655884718438c03517a67dee Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 16 Mar 2026 12:23:33 -0500 Subject: [PATCH] fix: use money endpoint for scout token wallet deduction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit db_patch with wallet param was silently ignored by the API — wallet mutations require the dedicated teams/{id}/money/{amount} endpoint. Co-Authored-By: Claude Opus 4.6 (1M context) --- discord_ui/scout_view.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/discord_ui/scout_view.py b/discord_ui/scout_view.py index e225dd1..ffeff87 100644 --- a/discord_ui/scout_view.py +++ b/discord_ui/scout_view.py @@ -11,7 +11,7 @@ import logging import discord -from api_calls import db_get, db_patch, db_post +from api_calls import db_get, db_post from helpers.main import get_team_by_owner, get_card_embeds from helpers.scouting import ( SCOUT_TOKEN_COST, @@ -340,9 +340,7 @@ class BuyScoutTokenView(discord.ui.View): # Deduct currency new_wallet = team["wallet"] - SCOUT_TOKEN_COST try: - await db_patch( - "teams", object_id=team["id"], params=[("wallet", new_wallet)] - ) + await db_post(f'teams/{team["id"]}/money/-{SCOUT_TOKEN_COST}') except Exception as e: logger.error(f"Failed to deduct scout token cost: {e}") await interaction.response.edit_message(