Schema
Entry Points
- Bot API: OpenAPI JSON · Methods
- Realtime application:
core.proto - Realtime transport: Inline Protocol
- Generated packages: API Schema · Protocol Schema
Conventions
- Realtime IDs: 64-bit integers; TypeScript output uses
bigint. - Bot API IDs: JSON numbers in the supported range; inputs may accept decimal strings.
- Message identity: store
(chat_id, message_id). - Timestamps: Unix seconds unless documented otherwise.
- Message entity offsets: UTF-16 code units.
- Send identity: reuse a non-zero
SEND_MESSAGE.random_idonly for the same logical send.
Encode bigint for JSON:
TypeScript
const json = JSON.stringify(value, (_key, item) =>
typeof item === "bigint" ? item.toString() : item,
)