Skip to main content

Cookbook#

The long recipe, with CLI output captured from a real bot (“Learning diary”), is in the repo. The narrative of that file is Russian; the commands are the platform’s and do not depend on the prose language:

docs/cookbook-srl-bot.md

What it walks through:

  1. Scaffold and login (two kinds of token)
  2. Message handler and a database table
  3. Deploy and migrations (--dry-run, --safe, --yes)
  4. Inline buttons (callback_query)
  5. Mini App: endpoints/, static files, tgcloud.jsonc, then deploy so the build is fresh
  6. Debugging a silent bot (webhook_status, then webhook_sync)

Pitfalls covered there and in tgcloud://docs/*: relative imports with .js, no foreign keys, drops only through .deprecated, push does not build and does not migrate, a new handler can leave the webhook out of sync.