> ## Documentation index
> Fetch the complete documentation index at: https://tgcloud.docs7.io/llms.txt
> Ask it with GET https://tgcloud.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# Cookbook

> A serverless bot with a Mini App in one evening

# 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](https://github.com/sdamarketing/tgcloud_mcp/blob/main/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.
