Extracts the Telegram TL scheme from the Android apk, tdesktop and TDLib, merges the three, and publishes the result to GitHub, Telegraph and Telegram.
cp .env.sample .env # fill in tokens and ids
mkdir -p secrets # drop the GitHub App key in secrets/github.pem
docker compose up -d --buildDevelopment, with hot reload through air:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --buildOlder releases kept everything in a single JSON file. To carry that state over:
docker compose run --rm -v /path/to/storage.json:/tmp/storage.json bot \
importjson /tmp/storage.jsonSchema migrations live in internal/db/schema and are applied by goose at
startup. Queries live in internal/db/query; cmd/sqlgen turns them into typed
stores under internal/db — run it after touching either:
go run ./cmd/sqlgenThe generated *_gen.go files are not committed.
Sent from the chat configured as LOG_CHAT_ID:
| command | effect |
|---|---|
/patch |
force an extraction even if the store version has not moved |
/model |
list Gemini models; /model <id> selects one |
/branch |
show the tdesktop branch; /branch <sha> pins another |
/backup |
dump the database and upload it right here |
Every six hours the bot dumps the database with pg_dump -Fc and uploads it to
BACKUP_CHAT_ID. /backup does the same on demand, into the log chat.
To restore, send one of those dumps back into the log chat as a document. Any
.sql or .dump file posted there is fed to pg_restore --clean --if-exists,
which replaces the current database. The restore is refused while an
extraction is running.