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.
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
- Removed the old Serialization APIs: now serialization is done automatically by MadelineProto!
- Deprecated get_updates: it's still working
, but I recommend you switch to event handler for 100x speed improvements and parallel processing
- 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
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
locking, to prevent multiple instances of the bot from running together
- You can now use
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
- 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
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 of the more famous ReactPHP due to its speed, rich set of libraries and extreme ease of use.
Working with its devs is also nice; I already contributed to the amphp's libraries with some improvements and bugfixes (I will soon also implement a DNS over HTTPS client for AMPHP, to implement in MadelineProto's artax), and I invite you to do the same!
Even if you don't contribute to AMPHP, you can still use it: as I mentioned above, there are MANY libraries to work asynchronously with files, databases, DNS, HTTP; there's even an async windows registry client, used by the DNS client to fetch default DNS servers on windows!
When you use MadelineProto async, you have to also use an amphp async database client, artax instead of curl and guzzle, and so on: otherwise…