Breaking changes:
- Removed the deprecated
$MadelineProto->startAndLoop
method. Please useMyEventHandler::startAndLoop
instead, remove anynew \danog\MadelineProto\API
line you have in your code if you're only using the event handler. - Removed support for the long-deprecated
snake_case
methods, now onlycamelCase
is supported (get_info
will not work, onlygetInfo
; and so on). onStart
now blocks all updates until it finishes executing. Use the amphp async primitives to start long-running processes inonStart
like starting a webserver.
Features:
- Added an
extractMessageId
method.
Fixes:
- Fixed
getPwrChat
- Properly handle PTS exceptions
- Avoid fiber leaks by completely refactoring the loop API
- Fix garbage collection of API instances. To properly garbage collect API instances, run
EventLoop::run()
after unsetting all API instances; or if you just destroyed one instance and others are still running, keep using MadelineProto as usual, the garbage collector callbacks will be invoked by the event loop automatically.
Deprecations:
- The
\danog\Loop\Generic\PeriodicLoop
and\danog\Loop\Generic\GenericLoop
classes were deprecated. The alternatives are the new\danog\Loop\PeriodicLoop
and\danog\Loop\GenericLoop
, with a new and refactored API, see https://github.com/danog/loop for the new API. The old classes are still available, but will be removed in the next major release. - The
async
andloop
methods were deprecated, and will be removed in the next major release (v9). - All coroutine-related methods (Tools::callFork, etc) were deprecated, and will be removed in the next major release (v9). Use the amphp APIs, instead (ie
\Amp\async
or\Revolt\EventLoop::queue
instead ofTools::callFork
,Amp\Promise\awaitAll
instead ofTools::all
etc). - Coroutine support in the event handler will be completely removed in the next major release (v9).