merezarezaei / teleproto
Unified Telegram engine and framework: MTProto 2.0 (user + bot), Bot HTTP API, Mini App auth, Passport KYC, consumer layer (ingest, bus, daemon, backfill, backup) and a one-class handler facade (Teleframe)
Requires
- php: >=8.2
- ext-dom: *
- ext-hash: *
- ext-json: *
- ext-libxml: *
- ext-mbstring: *
- ext-openssl: *
- ext-zlib: *
- illuminate/console: ^10.0|^11.0|^12.0
- illuminate/filesystem: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.0
- illuminate/routing: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- laravel/prompts: ^0.3
- phpseclib/phpseclib: ^3.0
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- chillerlan/php-qrcode: ^6.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.0|^11.0
- spaze/phpstan-disallowed-calls: ^4.14
Suggests
- ext-bcmath: Alternative big-integer calculation engine if ext-gmp is not available.
- ext-gmp: Accelerates BigInteger modular arithmetic for Diffie-Hellman and 2FA SRP calculations.
- chillerlan/php-qrcode: Renders scannable terminal QR codes for the QR login flow (teleproto:login --qr).
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-20 09:11:56 UTC
README
Teleframe ⚡
Telegram power with almost zero friction — for PHP & Laravel.
One package for the whole Telegram surface: native MTProto 2.0 for users and bots, the Bot HTTP API, Mini App auth, Passport KYC, and — merged in as modules — the consumer layer (tenant-scoped Ingest, Redis stream Bus + daemon + backfill, encrypted backup vault) plus a one-class handler facade.
composer require merezarezaei/teleframe
One class composes everything
use MeRezaRezaei\Teleframe\Teleframe; $teleframe = app(Teleframe::class); $teleframe->onMessage(function ($update) use ($teleframe) { // every stored update reaches you through one pipeline $teleframe->send($update->accountId, ['random_id' => random_int(1, PHP_INT_MAX), 'text' => 'got it']); });
Teleframe— compose-not-own facade:ingest,ingestResponse,onMessage/on(route by constructor, zero-regex),run(fixtures through the REAL pipeline),user/chat/channel,route,backup,schemaLayer,send(writes the Q2d echo-elimination registry).Teleclient— the ingest-only public face, retained byte-stable.
What's inside
| Area | Namespace / docs | What it is |
|---|---|---|
| MTProto engine | MeRezaRezaei\Teleframe\Core\ |
Raw binary wire: transport, crypto (DH + 2FA SRP), TL codec (zero-regex), method registry, typed RPC exceptions, Layer 227 wire |
| Bot HTTP API | MeRezaRezaei\Teleframe\Bot\ |
BotClient, scopes, fluent builders, webhooks & polling |
| Schema pipeline | MeRezaRezaei\Teleframe\Schema\ + generated/ |
.tl → models/Methods builders, teleframe:schema-update (diff + regenerate + stamp, no migrate), Layer 229 catalog |
| Laravel glue | MeRezaRezaei\Teleframe\Laravel\ |
TeleframeServiceProvider, teleframe:* commands, webhook route macro, Mini App middleware, facades |
| Consumer modules | MeRezaRezaei\Teleframe\{Ingest,Bus,Daemon,Backfill,Backup}\ |
ingest.md · bus.md · backup.md |
| Handlers | MeRezaRezaei\Teleframe\Handler\ |
handlers.md — registry + 26-line onion + echo elimination + Testing\FakeDispatcher |
Docs: quickstart.md · index.md ·
php artisan teleframe:doctor.
Influence & credit
Teleframe draws heavily on the Nutgram-style handler ergonomics and follows the
owner's unification design (see docs/superpowers/specs/). The original
teleclient package that held the consumer layer is archived.
MIT licensed.