Developer docs

3. Object model

  • User — person or bot (is_bot). Referenced by id; username is optional and unique.
  • Chat — every conversation is a chat with a type: PRIVATE (2 users), SAVED (self), GROUP (members post), CHANNEL (admins post). Private chats are obtained with ChatsService/GetPrivateChat(user_id).
  • Message — (chat_id, id) where id is sequential per chat starting at 1. random_id is a client-generated 64-bit value: resending a SendMessage with the same random_id returns the original message instead of creating a duplicate, so always retry sends with the same random_id after network errors.
  • Text formatting — entities with offsets/lengths in UTF-16 code units. Alternatively send parse_mode = "markdown" | "html" and let the server parse.
  • Files — referenced by opaque file_id strings (server-signed capabilities). Never construct or parse them.
  • Responses that return objects referencing other objects include the referenced users / chats alongside (e.g. MessagesSlice.users), so a client can render without extra round-trips. Cache them by id; newer copies replace older ones.

Generated from docs/PROTOCOL.md in the Telvoro repository. Wire names such as televo.v1 are unchanged.