How sanyok12345/teleproto works
teleproto is a TypeScript Telegram MTProto client. The main workflow is that an application configures a client with a session, authenticates or resumes it, then invokes Telegram operations and handles incoming updates. The map highlights domain APIs, the update/event path, protocol transport, and session/TL state. README capabilities are included even where source excerpts were incomplete; edges for unsampled subsystem wiring are omitted where ownership could not be established.
Main entry points: TelegramClient.ts Telegram client · telegramBaseClient.ts Client runtime · MTProtoSender.ts MTProto sender · manager.ts Update manager
Components 23
Client workflows
- Telegram client
teleproto/client/TelegramClient.ts - Client runtime
teleproto/client/telegramBaseClient.ts - Authentication
teleproto/client/auth.ts - Messaging
teleproto/client/messages.ts - Chats and dialogs
teleproto/client/chats.ts - File transfer
teleproto/client/downloads.ts - Uploads
teleproto/client/uploads.ts - Account features
teleproto/client/account.ts
Updates and events
- Update manager
teleproto/client/updates/manager.ts - Update dispatch
teleproto/client/updates/dispatch.ts - Update subscriptions
teleproto/client/updates/composer.ts - Event builders
teleproto/events/index.ts
MTProto transport
- Network manager
teleproto/network/Network.ts - MTProto sender
teleproto/network/MTProtoSender.ts - Connections
teleproto/network/connection/index.ts - Protocol crypto
teleproto/crypto/crypto.ts
Session and entities
- Session storage
teleproto/sessions/index.ts - Entity cache
teleproto/entityCache.ts
TL schema and types
- Raw API proxy
teleproto/tl/runtime/apiProxy.ts - TL schema types
teleproto/tl/api.ts - Custom TL objects
teleproto/tl/custom/index.ts
Other components
- Application
- Telegram
Connections 24
- Application → Telegram client: configures and calls
- Telegram client → Client runtime: inherits runtime
- Telegram client → Authentication: starts sign-in
- Telegram client → Messaging: delegates messaging
- Telegram client → Chats and dialogs: delegates chat actions
- Telegram client → Update manager: manages updates
- Telegram client → Raw API proxy: exposes raw API
- Telegram client → File transfer: downloads media
- Telegram client → Uploads: uploads media
- Telegram client → Account features: offers account actions
- Client runtime → Session storage: loads and saves
- Client runtime → Network manager: manages transport
- Client runtime → Entity cache: creates cache
- Authentication → Telegram: authenticates with
- Network manager → MTProto sender: provides sessions
- MTProto sender → Connections: sends packets
- MTProto sender → Protocol crypto: protects messages
- MTProto sender → Telegram: exchanges MTProto
- Telegram → Update manager: sends updates
- Update manager → Update dispatch: dispatches updates
- Update manager → Entity cache: caches entities
- Update subscriptions → Event builders: builds event handlers
- Raw API proxy → TL schema types: constructs TL requests
- Telegram client → Custom TL objects: uses custom objects