Show the destination, result and loot in Sokko TCG Discord alerts, with a button to the expedition
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 23m48s
Validate and deploy Sokko G / deploy (push) Successful in 16s

- Each queued alert keeps an embed and a link button: the destination illustration as thumbnail, the tier, score and loot for a return, the difficulty and automatic departure for a new group.
- The button and the message link open #/cards/expeditions/<id>, which scrolls to the player's expedition or group and highlights it; Discord login now returns to that link.
- Without an https CARDS_PUBLIC_ORIGIN the link stays in the text, without button or thumbnail, which Discord would refuse.
- Delivery docs name palico-bot's NOTIFICATIONS_API_KEY and its local-only route on port 3101.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-29 11:35:15 +01:00
parent 734a3b6a8b
commit 82cebd0fd1
17 changed files with 184 additions and 37 deletions

View file

@ -383,7 +383,11 @@ Expéditions (migration 8, règles pures dans `services/cards/expedition-rules.j
failed_at, last_error)` est la file des messages privés : l'ouverture d'un groupe y met un message pour
chaque autre joueur abonné ; toutes les 30 secondes, le serveur y ajoute les expéditions rentrées
(`expedition_members.alerted_at` évite les doublons), puis envoie les messages en attente à palico-bot
(`CARDS_DISCORD_ALERTS_URL`, `CARDS_DISCORD_ALERTS_KEY`). Un refus définitif (compte inconnu, messages
(`CARDS_DISCORD_ALERTS_URL`, `CARDS_DISCORD_ALERTS_KEY`). `alert_outbox.extra_json` (migration 33)
garde l'embed et le bouton du message (`services/cards/alert-messages.js`) : destination en vignette,
résultat et butin pour un retour, difficulté et départ automatique pour un groupe, et un lien direct
`#/cards/expeditions/<id>` qui met l'expédition en vue (aussi accepté comme retour après la connexion).
Sans `CARDS_PUBLIC_ORIGIN` en `https`, ni bouton ni vignette. Un refus définitif (compte inconnu, messages
privés fermés) ou cinq échecs arrêtent les essais. Seuls les comptes Discord réels (identifiant
numérique) reçoivent des alertes ; le réglage `alerts.enabled` les coupe toutes. Les lignes envoyées
ou abandonnées sont purgées après 30 jours ; un compte supprimé perd ses choix et sa file.