Auto merge dev → main (#1332)
* feat(tssbot): build_match_logs + match_logs persistence * feat(tssbot): create match_logs table and write logs at ingest * feat(tssbot): one-time match_logs backfill script * feat(srebot): persist chat/battle logs to match_logs (parity, no backfill) * feat(tssbot): Battle/Chat Log buttons on Discord scoreboards
This commit is contained in:
@@ -1497,6 +1497,16 @@ def transform_to_local_format(api_data: Dict[str, Any]) -> Optional[Dict[str, An
|
||||
if loser_team_slot:
|
||||
team_slot_names[loser_team_slot] = loser_squadron
|
||||
|
||||
try:
|
||||
from BOT.match_logs_store import upsert_match_logs_sync
|
||||
from pathlib import Path as _Path
|
||||
import os as _os
|
||||
_sq = _Path(_os.environ["STORAGE_VOL_PATH"]) / "sq_battles.db"
|
||||
if session_id_hex:
|
||||
upsert_match_logs_sync(_sq, session_id_hex, chat_log, battle_log)
|
||||
except Exception as _e:
|
||||
logging.error(f"match_logs upsert failed for {session_id_hex}: {_e}")
|
||||
|
||||
return {
|
||||
"winning_team_squadron": winner_squadron,
|
||||
"losing_team_squadron": loser_squadron,
|
||||
|
||||
Reference in New Issue
Block a user