Show the destination, result and loot in Sokko TCG Discord alerts, with a button to the expedition
- 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:
parent
734a3b6a8b
commit
82cebd0fd1
17 changed files with 184 additions and 37 deletions
|
|
@ -64,8 +64,9 @@ function oauthReturnCookie(value, secure, maxAge = 600) {
|
|||
return cookie("sokkog_cards_oauth_return", value, secure, maxAge);
|
||||
}
|
||||
|
||||
// Retour après la connexion Discord : une section du jeu, ou le lien direct d'une expédition (#/cards/expeditions/<id>).
|
||||
function cardsReturnPath(value) {
|
||||
return /^\/cards(?:\/admin(?:\/[a-z0-9-]{1,40}){0,2}|\/[a-z0-9-]{1,40})?$/.test(String(value || "")) ? value : "/cards";
|
||||
return /^\/cards(?:\/admin(?:\/[a-z0-9-]{1,40}){0,2}|\/expeditions\/[a-z0-9-]{1,40}|\/[a-z0-9-]{1,40})?$/.test(String(value || "")) ? value : "/cards";
|
||||
}
|
||||
|
||||
async function readBody(req) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue