Skip to content

Releases: danog/MadelineProto

MadelineProto 8 beta 111

19 Jul 16:17
6372194
Compare
Choose a tag to compare

Improve logging.

MadelineProto 8 beta 110

19 Jul 14:53
bde2d0e
Compare
Choose a tag to compare

Fixes:

  • Fix thumbnail parsing
  • Fix parsing of round videos in some conditions
  • Fix content-type/extension of getDownloadLink/downloadToBrowser

MadelineProto 8 beta 109

19 Jul 06:24
1ba93f1
Compare
Choose a tag to compare

Features:

  • Allow specifying a class name to getEventHandler

Fixes:

  • Fix FilterCommand

MadelineProto 8 beta 108

18 Jul 19:50
Compare
Choose a tag to compare

Features:

  • Allow specifying command types in FilterCommand

Fixes:

  • Fix localization issues
  • More pure phar fixes

MadelineProto 8 beta 107

18 Jul 17:44
34a226c
Compare
Choose a tag to compare

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

17 Jul 06:13
Compare
Choose a tag to compare

This release fixes standalone usage of madeline.phar files.

Combined event handler fixes.

16 Jul 21:31
Compare
Choose a tag to compare
8.0.0-beta105

Update release

Fix 8.1 support

16 Jul 20:11
Compare
Choose a tag to compare

This release fixes PHP 8.1 support.

getDownloadLink fixes

16 Jul 18:35
Compare
Choose a tag to compare

Fixed a small issue with getDownloadLink.

getDownloadLink: MadelineProto 8.0.0-beta101!

16 Jul 16:54
Compare
Choose a tag to compare

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.