Releases: danog/MadelineProto
MadelineProto 8 beta 111
Improve logging.
MadelineProto 8 beta 110
Fixes:
- Fix thumbnail parsing
- Fix parsing of round videos in some conditions
- Fix content-type/extension of getDownloadLink/downloadToBrowser
MadelineProto 8 beta 109
Features:
- Allow specifying a class name to getEventHandler
Fixes:
- Fix FilterCommand
MadelineProto 8 beta 108
Features:
- Allow specifying command types in FilterCommand
Fixes:
- Fix localization issues
- More pure phar fixes
MadelineProto 8 beta 107
MadelineProto was updated (8.0.0-beta107)!
Features:
- Add getPeriodicLoops function to get all periodic loops created by Cron attribtues
- Add isReply bound method
- Add exception logging in the browser
Fixes:
- Relax dl.php verification for
getDownloadLink
- Made more fixes to photo bot API conversion
- Fix functions.php plugin inclusion
MadelineProto 8 beta 106
This release fixes standalone usage of madeline.phar
files.
Combined event handler fixes.
8.0.0-beta105 Update release
Fix 8.1 support
This release fixes PHP 8.1 support.
getDownloadLink fixes
Fixed a small issue with getDownloadLink
.
getDownloadLink: MadelineProto 8.0.0-beta101!
MadelineProto was updated (8.0.0-beta101)!
After introducing plugins », bound methods », filters », a built-in cron system », IPC support for the event handler » and automatic static analysis for event handler code » in beta100, beta101 brings some bugfixes and the getDownloadLink
function!
Features:
- Added a
getDownloadLink
function, that can be used to fetch a download link for any file up to 4GB! - Added an
openFileAppendOnly
function, that can be used to asynchronously open a file in append-only mode!
Fixes:
- Improved the
markdownEscape
function! - Translated even more MadelineProto UI elements!
- Improve the static analyzer.
- Made some fixes to simple filters.
- Relax markdown parser.
- Fix quality selection of photos.
Here's an example on how to use the new getDownloadLink()
function:
<?php
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();
$link = $MadelineProto->getDownloadLink($MessageMedia);
$MessageMedia
can be a a media object or even a bot API file ID (files up to 4GB are supported!).
You can also use the new getDownloadLink()
bound method:
class MyEventHandler extends SimpleEventHandler {
/**
* Gets a download link for any file up to 4GB!
*/
#[FilterCommand('dl')]
public function downloadLink(Incoming&Message $message): void
{
if (!$message->replyToMsgId) {
$message->reply("This command must reply to a media message!");
return;
}
$message = $message->getReply();
if (!$message instanceof Message || !$message->media) {
$message->reply("This command must reply to a media message!");
return;
}
$message->reply("Download link: ".$message->media->getDownloadLink());
}
}
In both cases, the download link will be generated automatically if running via web.
If running via cli (or if URL rewriting is enabled), an additional step is required, see the documentation for more info.