/** * The bot-id key namespace — a PERSISTED CONTRACT, not a convenience. * * `bot-:` / `bot-:` is the shape of every storage * key this library writes: `botSession` keying, the menu's Forget/Export, * access-control records, payments charge indexes. Those keys live in the * consumer's Redis/D1/SQLite rows, so the shape must never drift — change * it and every deployed bot orphans its state. This module is the single * owner; everything else derives from here. * * Pure functions of `ctx.bot.info.id` (no env, no fs) — Worker-safe by * construction, guarded by test:worker-safe. */ /** * Returns the calling bot's numeric id from `ctx.bot.info.id`. Throws * if called before `bot.start()` / `bot.init()` populates it — should * never happen from inside an event handler, where gramio guarantees * `bot.info` is set. * * Note on the structural cast: gramio's `BotLike` (the interface * contexts are typed against) intentionally omits `info` to decouple * Context types from the full Bot class. At runtime `ctx.bot` IS the * full Bot, so the cast is sound — just papering over a deliberate * type-vs-runtime gap. */ export declare const botId: (ctx: { bot: unknown; }) => number; /** * Computes the storage key for an arbitrary user under the CALLING * bot's namespace. Use whenever a plugin needs to read or write * **another user's** session record from inside a handler (typical: * admin approves a stranger, /forget wipes a stranger after a takedown * request). For the current user, the session plugin handles keying * automatically when wired via `botSession`. */ export declare const botStorageKey: (ctx: { bot: unknown; }, userId: number) => string; /** * Static-key variant — namespace an arbitrary sub-key (e.g. an admin * index, a feature flag, a counter) under the calling bot's prefix. * Use this for bot-side state that isn't keyed by a specific user. * * botSubKey(ctx, 'ac:index') → 'bot-:ac:index' * botSubKey(ctx, 'metrics') → 'bot-:metrics' */ export declare const botSubKey: (ctx: { bot: unknown; }, subKey: string) => string; //# sourceMappingURL=keys.d.ts.map