TGViewer
PWRTelegram API channel PWRTelegram API channel @pwrtelegram · 725 subscribers
Post #477 684

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

MadelineProto 4.0 was released!

100x speed improvement + parallel processing of each update, and much more!

You don't have to change your code to use the new version.
You don't have to define('MADELINE_BRANCH', ''); in your scripts to use the new version anymore, it will be loaded automatically!
By default, the latest stable release of MadelineProto 4.0 will be loaded: to load the latest alpha version, use define('MADELINE_BRANCH', ''); or define('MADELINE_BRANCH', 'master');.

MadelineProto 4.0 async does not support all webhosts, due to their highly modified PHP stacks (000webhost does not seem to work properly, altervista surprisingly works).

To load the deprecated v3 version on these webhosts, write define('MADELINE_BRANCH', 'deprecated'); before including madeline.php.
Note: I will not provide support for the deprecated version of MadelineProto: I will not fix bugs or write documentation for the old version.
The documentation will not contain info about API methods present in the old version, and eventually the old version may stop working: I invite you to switch to a better webhost using MadelineProto 4.0 to avoid these issues.

Breaking changes:
- Removed the old Serialization APIs: now serialization is done automatically by MadelineProto!

Deprecations:
- Deprecated get_updates: it's still working, but I recommend you switch to event handler for 100x speed improvements and parallel processing


Changes:
- Documented the MyTelegramOrgWrapper API, that can be used to login programmaticaly to the my.telegram.org management page and get the API ID of your app.
- Improved chat message splitting algorithm
- Removed all dependencies to curl: now all HTTP requests are made asynchronously using a custom version of artax
- Updated php-libtgvoip and introduced a common API for changing phone call settings
- Improved the madeline.php loader
- Increased the default flood wait limit to 10 minutes, since with async waiting for the flood wait isn't blocking anymore
- When running from web, MadelineProto will also automatically enable logging of PHP errors (not MadelineProto logs) to a MadelineProto.log file located in the same directory as the script that loaded MadelineProto.

New API features:
- Fully async logic!
- MTProxy and dynamic proxy support!
- Very important, I wrote documentation on what to do if your account gets banned.
- I commited a few crimes by bringing back support for PHP 5.6 and PHP 7.0 using a heavily modified version of 7to5 and 7to70 if you load MadelineProto using madeline.php: async is supported on PHP 5.6!
However, I do not recommend you use PHP 5 or 7.0: I did this only to support async logic on webhosts, if you're running on your own machine install PHP 7.3+ (PHP 7.1 isn't recommended due to some socket bugs).

- Shutdown API, for executing operations on shutdown
- Built-in locking, to prevent multiple instances of the bot from running together
- You can now use the @support username in sendMessage and other methods to send messages to the support user!
- Now MadelineProto will automatically try to get the access hash of users not present in the internal peer database (this should reduce errors)!
- If any file cannot be downloaded to due issues with the tg media server that is hosting it, it will be automatically sent to the @support user (settings).
- Added a resetUpdateState method to reset the update state and fetch ALL updates from the beginning
- Added a __magic_sleep substitute for __sleep in the CombinedEventHandler
- Added support for automatic file uploads by name in secret chats (as with normal chats); you can also now send secret chat messages using the sendMessage method as if it were a normal chat
- Rewritten the APIFactory, the abstraction layer that stands between you and MadelineProto when you do $MadelineProto->method(): it is now fully async, and MUCH faster thanks to a new cached method mapping system.
- The same cached method mapping system is also used for the event handler, which means that now the event handler is the fastest update management method.
Telegram MadelineProto | Official Channel Writing MadelineProto async, I really enjoyed working with the AMPHP framework: it is very fast, has multiple packages to work asynchronously with HTTP requests, websockets, databases (MySQL, redis, postgres, DNS, sockets and much more)! I chose AMPHP instead…
More from @pwrtelegram
  1. Oct 17, 2026Introducing MadelineProto 8.8.8, with video calls, group calls, livestreams and end-to-end…
  2. May 11, 2025And then, a long overdue post about my Autonomous System (AS198747), and an over more over…
  3. May 11, 2025The first series of posts I'll be adding here will be some technical deep dives into the p…
  4. May 11, 2025Happy to announce I've launched a blog, where I'll be posting news about all my different…
  5. Aug 25, 2024#FreeDurov.
  6. May 30, 2024MadelineProto was updated! MadelineProto 8.1.0 introduces an official Grafana dashboard fo…
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 →