Files
miti99bot/src/modules/misc
tiennm99 c8ce28a15b docs: add per-module READMEs with architecture and DB schemas
Each module now has a README.md documenting commands, architecture,
and database schema (KV keys, JSON structure, field descriptions).
Trading README enhanced with full schemas for user portfolio and
price cache objects.
2026-04-14 15:53:37 +07:00
..

Misc Module

Health check and DB demonstration. Exercises all three visibility levels.

Commands

Command Visibility Description
/ping public Health check — replies "pong" and records timestamp
/mstats protected Shows last /ping timestamp
/fortytwo private Easter egg — replies "The answer."

Architecture

  • /ping writes a timestamp to KV on every call (best-effort — KV failure doesn't block the reply).
  • /mstats reads the last ping timestamp and formats it as ISO string.
  • /fortytwo is a hidden command demonstrating private visibility.

Database

KV namespace prefix: misc:

Key Type Description Example
last_ping JSON Timestamp of the most recent /ping call { "at": 1713100000000 }

Schema: last_ping

{
  "at": 1713100000000
}
  • at — Unix epoch milliseconds (Date.now())