fix: add pack_id to scouted card creation, enhance embed with card links
All checks were successful
Build Docker Image / build (push) Successful in 1m16s

- Include pack_id in db_post("cards") payload (API requires it)
- Player names now link to card image URLs in scout embed
- Display format: "🟡 All-Star — [2023 Mike Trout](card_image_url)"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-06 13:22:45 -06:00
parent 77c3f3004c
commit 8e605c2140
2 changed files with 9 additions and 1 deletions

View File

@ -221,6 +221,7 @@ class ScoutButton(discord.ui.Button):
{
"player_id": self.card["player"]["player_id"],
"team_id": scouter_team["id"],
"pack_id": self.card["pack"]["id"],
}
],
},

View File

@ -52,10 +52,17 @@ def _build_card_lines(cards: list[dict]) -> list[tuple[int, str]]:
player = card["player"]
rarity_val = player["rarity"]["value"]
symbol = RARITY_SYMBOLS.get(rarity_val, "\u26ab")
desc = player.get("description", "")
image_url = player.get("image", "")
name_display = (
f"[{desc} {player['p_name']}]({image_url})"
if image_url
else f"{desc} {player['p_name']}"
)
lines.append(
(
player["player_id"],
f"{symbol} {player['rarity']['name']}{player['p_name']}",
f"{symbol} {player['rarity']['name']}{name_display}",
)
)
random.shuffle(lines)