Repository navigation
How It Works
Foundry (GM browser) Bot (your server) Discord
─────────────────── ───────────────── ───────
snapshot of linked PCs ── POST ──▶ store.json (per world) ◀── /roll ── players
+ active-scene creatures │ GM DMs
│ rolls, requests, saves
every 20 s: │
GET actions ◀──────────── queued: damage, conditions, initiative… ◀── GM buttons
POST ack ─────────────▶ GM DMs show ✅ / ⚠️
GET rolls ◀──────────── new rolls → Foundry chat
When a GM has a world open, the module builds a snapshot:
- each linked PC: every roll it can make (rollables), plus extras such as AC, spell DC, Hero Points or Inspiration, dying or death saves;
- each NPC on the active scene: AC, conditions, weaknesses and its own rollables.
A system adapter (PF2e, 5e, Draw Steel, Daggerheart) turns the character into neutral rollables: a label, dice, a modifier and a rule such as pf2e-degrees, pass-fail, ds-tiers or duality. The bot doesn't need Foundry to roll: it uses the last snapshot, which is why rolls work with Foundry closed.
Snapshots refresh automatically about 10 seconds after a change, while a GM is online.
The bot rolls the dice itself, applies the rule (degrees, hit/miss, tiers, Hope/Fear), posts the public card and DMs every GM. It keeps everything in DATA_DIR/store.json.
Anything that must change Foundry is queued in the bot instead of applied directly:
| Action | Applied in Foundry |
|---|---|
applyDamage |
damage or healing on a token or PC, with the system's resistance rules |
condition |
Prone, Frightened 2, Grabbed… (PF2e) |
initiative |
combatant initiative in the active encounter |
heroPoint |
spend/give Hero Points (PF2e) or Inspiration (5e) |
recovery |
PF2e dying up/down |
deathSave |
5e death save marks |
The primary GM's browser polls the queue every 20 seconds, applies each action and reports back, and the GM DMs update. If no GM is online, actions wait. Finished actions are pruned after 30 days.
Every 20 seconds the GM's browser also imports new Discord rolls into the world's chat, so the campaign keeps a full record. The cards hide the DC and outcome from players; GMs see them. Secret rolls are whispered to GMs.
Getting started
- Installation
- Bot Setup
- Hosting (Forge, cloud, VPS)
- Foundry Setup
Using it
Systems
Reference