[www] auto reward on join

This commit is contained in:
Devin Zuczek
2026-09-27 21:04:59 -04:00
parent b32b16c1f0
commit 3324a935b4
9 changed files with 263 additions and 32 deletions
+5
View File
@@ -600,6 +600,11 @@ role that role's RecCenterTokens in a gift box, every time it fires. The map is
for the box. An offline player finds the box on their next `GET /api/avatar/v2/gifts`.
- A grant that fails partway is logged with the account, role and amount and is not retried —
a retry that also failed partway is how a balance gets credited twice.
- **The first link is paid on demand.** `www`'s benefits claim calls `grantDiscordRoleGift`
— one account, the roles Discord just served, the same map and box — the first time an
account links its Discord, so a new supporter gets one box now rather than after the next
run. `www` decides "first" from the link table; this module keeps no ledger either way, and
the cron pays that account again on its next run like everyone else.
One D1 read for the links, then a handful of writes and two hub calls per box, sequentially.
A cron invocation has a fixed subrequest budget (50 free, 1000 paid); a community whose