Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 1.45 KB

HOW_TO_UPDATE_TELEGRAM_API.md

File metadata and controls

24 lines (17 loc) · 1.45 KB

Updating the Telegram APIs

This repository has two schema inputs. They are updated differently.

MTProto (the client): reproducible from this repository

  1. Replace schema/main_api.tl, schema/sys_msgs.tl and schema/auth_key.tl with the new layer. Keep the layer line in main_api.tl current.
  2. Set the layer the client sends: kLayer in src/client.cpp.
  3. Regenerate: make tl-generate.
  4. Check: make schema-check. It must pass, and schema/SHA256SUMS.txt must be updated with bash tools/update_schema_checksums.sh.
  5. Run the offline suites (make test). Read the results. Do not edit generated files by hand.

See schema/README.md for the inputs and the generated files.

Bot API (cppgram::bot): generator NOT in this repository

src/ApiMethods.cpp and include/cppgram/bot/ApiMethods.inc.h say they are generated by make api-generate. That target, its generator, and the make api-update step do not exist in this repository. The Bot API spec files in api/ (telegram-bot-api.yaml, codegen.yaml) are inputs to that external generator and are not read by any build step here.

The Bot API layer compiles and its tests pass (cppgram_bot_test), but the generated files cannot be regenerated from this repository. Changing the Bot API surface means editing the generated files, which the headers forbid, or restoring the generator. Until one of those happens, treat the Bot API layer as frozen. This is listed in KNOWN_LIMITATIONS.md.