TGViewer
MadelineProto | Official Channel MadelineProto | Official Channel @madelineproto · 6.41K subscribers
Post #449 4.92K
MadelineProto started as a hobby project, back when I knew nothing about cryptography, telegram's APIs, async or programming standards:

before, MadelineProto was created piece by piece as a single monolothic class composed of multiple traits;
now, MadelineProto is composed of multiple modular APIs that are well-structured, heavily commented, wrappable, extendable in any possible and immaginable way.

I am really happy with how MadelineProto async turned out.
I had an absolute blast working on this update, and implementing async really opened a whole sea of possible innovations and features I can implement in MadelineProto now:

- Automatically asyncify your scripts (w/ php-parser).
- Async file upload by url (1.5gb)
- Get direct download url of any file (1.5gb)
- TON (this is actually going to be a lot of fun)
- group calls (the php-libtgvoip APIs are actually ready, I just need to wrap them in php-libtgvoip)
- video calls (~)
- native calls:
With MadelineProto async, I can finally properly implement native async phone calls in PHP:
this will allow handling phone calls on webhosts!
I already have some code I created a year ago for this backed up in a private gitlab repo :)
- async iterators:
I've been thinking of using AMPHP's async iterator API (after some modding obviously) to create async iterators for easily iterating over the messages of a group, and for doing other operations that would normally require using offsets:


foreach ($MadelineProto->getMessages('@group') as $message) {
// stuff
}


This shouldn't be too hard to implement, and with a proper (maybe separate OOP) API, it's going to be fun to make and use.

- snake_case => CamelCase conversion for all API methods:
Previously, MadelineProto's custom API methods (get_info, download_to_dir) used snake_case, which contrasted with the Telegram API methods (sendMessage), and is against PHP coding standards.
Soon, I plan to update MadelineProto's docs to only use CamelCase for method names.

The old method name will still be available after that; right now, you can already use both naming conventions for all MadelineProto methods:


$MadelineProto->get_pwr_chat('user'); // OK!
$MadelineProto->getPwrChat('user'); // OK!


However, I recommend you now use the CamelCase version of methods.

- ArrayAccess on promises (to be able to do yield $method()['result'] instead of (yield $method())['result'])
- An openChat method, inspired by tdlib, to enable fetching updates from groups you aren't a member of
- Add support for Telegram passport in 2FA and write some wrapper APIs
- Write some simplified APIs for takeout (can be implemented using async iterators)
- #MadelineProtoForNode async and lua async (the second can already be done now, the first is also pretty easy now that async is here :)))))
- DNS over HTTPS everywhere
- Parallelize some methods like the download method, or getPwrChat (upload is already fully parallelized)
- Get sponsor of MTProxies
- Optional max_id and min_id params in methods
- Update to layer 100 (for global group permissions & more)
- #phase1 🇮🇷🇷🇺

You can expect to see the following features in the next relases of MadelineProto.
More from @madelineproto
  1. Oct 17, 2026Introducing MadelineProto 8.8.8, with video calls, group calls, livestreams and end-to-end…
  2. Oct 17, 2026Introducing MadelineProto 8.8.8, with video calls, group calls, livestreams and end-to-end…
  3. Jul 26, 2026Native, pure-PHP (no FFI, no shell, 💯 webhost support) group and video calls are working…
  4. Jun 16, 2026MadelineProto may also be affected if your upstreams aren't filtering invalid routes via R…
  5. Jun 16, 2026Indeed, looking at the announced routes i.e. in https://bgp.he.net/AS18101#_prefixes + htt…
  6. Jun 16, 2026⚠️ Indian telecom Reliance is sabotaging access to Telegram for millions of users OUTSIDE…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →