Technical DocsSchema

Schema

Entry Points

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_id only for the same logical send.

Encode bigint for JSON:

TypeScript
const json = JSON.stringify(value, (_key, item) =>
  typeof item === "bigint" ? item.toString() : item,
)