Merge pull request 'fix: use money endpoint for scout token wallet deduction' (#90) from fix/scout-token-deduction into main
All checks were successful
Build Docker Image / build (push) Successful in 57s

Reviewed-on: #90
This commit is contained in:
cal 2026-03-16 17:50:40 +00:00
commit 8da9157f3c

View File

@ -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(