Skip to main content

Module bots

Module bots 

Source
Expand description

Last-known bot manifests (kind 10304) — the / command picker’s persistent layer. One row per bot pubkey, replaced only by a NEWER manifest edition, so the picker serves instantly from boot while a background refetch converges. Manifests are PUBLIC replaceable events: rows are plaintext by design.

Functions§

get_bot_manifest
Last-known manifest JSON for one bot, with its edition timestamp.
get_bot_manifests
Last-known manifests for a set of bots: (pubkey_hex, manifest_json). Bots with no stored manifest are simply absent.
upsert_bot_manifest
Store a validated manifest for pubkey_hex, keeping whichever edition is newest (event_created_at = the manifest event’s timestamp). An equal-time re-fetch refreshes fetched_at only via the replace (idempotent).