⏳
Cooldown
vault.cooldownThe VaultVaultLets something happen once per time window: a /daily reward, a /work shift, a /rob that needs to cool off. The first time it's Ready and starts the timer; until the time is up it's Cooling, with {{cooldown.left}} saying how long to wait. No table needed — the Vault keeps track for you.
When to use this
- →Spells with the same cooldown name share it — /daily and /claim can't both pay out
- →<t:{{cooldown.ready_at}}:R> shows a live Discord countdown
- →Inside 🔐 All-or-Nothing, a box that gets undone gives the cooldown back too
On the canvas
This is what Cooldown looks like when you place it on your flow. Each field below is something you configure in the inspector panel.
⏳Vault
Cooldown
vault.cooldownnamerequired
daily
who
Everyone shares one when empty
everyrequired
24
unit
select…
asrequired
cooldown
ready
cooling
Config fields
| Field | Type | Req | What it does |
|---|---|---|---|
namedaily | text | yes | Cooldown name 🏷️ |
whoEveryone shares one when empty | text | — | For who 👤 |
every24 | number | yes | Every |
unit | select | — | Unit ⏱️ |
ascooldown | text | yes | Save it as ✨ |
Output ports
readyGo ahead — the timer has started again
coolingToo soon — {{cooldown.left}} says how long is left
📐
In TypeScript, this would be…
Not something you need to write — just a look at what Kitcord does for you.
TypeScript
const now = Date.now();
const started = await db.get(
`INSERT INTO cooldowns (name, who, until) VALUES ('daily', ?, ?)
ON CONFLICT(name, who) DO UPDATE SET until = excluded.until WHERE until <= ?
RETURNING until`,
[userId, now + 24 * 3600_000, now],
);
// started → Ready ✓ ; otherwise Cooling ⏳ with {{cooldown.left}}Related pieces
More Vault pieces