Forwarded from MadelineProto | Official Channel (Daniil Gentili)
MadelineProto | Official Channel
Here's a more detailed explanation of the most important new features of MadelineProto 8.0.0-beta100! - Native plugin system To create a plugin, simply create an event handler that extends PluginEventHandler. For example, create a plugins/Danogentili/PingPlugin.php…
Coming up next, even more abstracted media methods, keyboard builders, a new web UI, MadelineProto in the browser with WASM, a
getDownloadLink method and much more!PWRTelegram API channel pinned «Introducing MadelineProto's biggest update yet, 8.0.0-beta100! This version introduces plugins », bound methods », filters », a built-in cron system », IPC support for the event handler » and automatic static analysis for event handler code ». See the following…»
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
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
Other features:
- Added an
Fixes:
- Improved the
- Translated even more MadelineProto UI elements!
- Improve the static analyzer.
- Made some fixes to simple filters.
- Relax markdown parser.
Here's an example on how to use the new
You can also use the new
If running via cli (or if URL rewriting is enabled), an additional step is required, see the documentation for more info.
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!getDownloadLink can be used to fetch a direct download link for any file up to 4GB, even using a bot API file ID!Other features:
- 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.
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.
docs.madelineproto.xyz
Plugins
MadelineProto offers a native plugin system, based on event handlers!
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
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
Other features:
- Added an
Fixes:
- Improved the
- Translated even more MadelineProto UI elements!
- Improve the static analyzer.
- Made some fixes to simple filters.
- Relax markdown parser.
Here's an example on how to use the new
You can also use the new
If running via cli (or if URL rewriting is enabled), an additional step is required, see the documentation for more info.
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!getDownloadLink can be used to fetch a direct download link for any file up to 4GB, even using a bot API file ID!Other features:
- 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.
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.
docs.madelineproto.xyz
Plugins
MadelineProto offers a native plugin system, based on event handlers!
MadelineProto | Official Channel
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…
Update: fixed a small issue with the quality selections of photos and getDownloadLink with bot api file ids, run composer update to get the latest version (beta102)!
MadelineProto now has alpha support for Telegram Stories in 8.0.0-beta113!
New Methods:
- users.getStoriesMaxIDs
- account.invalidateSignInCodes
- contacts.editCloseFriends
- contacts.toggleStoriesHidden
- channels.clickSponsoredMessage
- stories.sendStory
- stories.editStory
- stories.deleteStories
- stories.togglePinned
- stories.getAllStories
- stories.getUserStories
- stories.getPinnedStories
- stories.getStoriesArchive
- stories.getStoriesByID
- stories.toggleAllStoriesHidden
- stories.getAllReadUserStories
- stories.readStories
- stories.incrementStoryViews
- stories.getStoryViewsList
- stories.getStoriesViews
- stories.exportStoryLink
- stories.report
New Constructors:
- inputMediaStory
- messageMediaStory
- updateStory
- updateReadStories
- updateStoryID
- inputPrivacyKeyAbout
- privacyKeyAbout
- inputPrivacyValueAllowCloseFriends
- privacyValueAllowCloseFriends
- webPageAttributeStory
- messageReplyStoryHeader
- messagePeerVote
- messagePeerVoteInputOption
- messagePeerVoteMultiple
- sponsoredWebPage
- storyViews
- storyItemDeleted
- storyItemSkipped
- storyItem
- userStories
- stories.allStoriesNotModified
- stories.allStories
- stories.stories
- stories.userStories
- storyView
- stories.storyViewsList
- stories.storyViews
- inputReplyToMessage
- inputReplyToStory
- exportedStoryLink
Changed Constructors:
Added close_friend param to user
Added stories_hidden param to user
Added stories_unavailable param to user
Added stories_max_id param to user
Added alt_document param to messageMediaDocument
Added stories_muted param to inputPeerNotifySettings
Added stories_hide_sender param to inputPeerNotifySettings
Added stories_sound param to inputPeerNotifySettings
Added stories_muted param to peerNotifySettings
Added stories_hide_sender param to peerNotifySettings
Added stories_ios_sound param to peerNotifySettings
Added stories_android_sound param to peerNotifySettings
Added stories_other_sound param to peerNotifySettings
Added stories_pinned_available param to userFull
Added stories param to userFull
Added peer param to updateMessagePollVote
Removed user_id param from updateMessagePollVote
Added nosound param to documentAttributeVideo
Added preload_prefix_size param to documentAttributeVideo
Added stories_preload param to autoDownloadSettings
Added small_queue_active_operations_max param to autoDownloadSettings
Added large_queue_active_operations_max param to autoDownloadSettings
Added chats param to messages.votesList
Added keep_archived_unmuted param to globalPrivacySettings
Added keep_archived_folders param to globalPrivacySettings
Added webpage param to sponsoredMessage
Added my param to messagePeerReaction
New Methods:
- users.getStoriesMaxIDs
- account.invalidateSignInCodes
- contacts.editCloseFriends
- contacts.toggleStoriesHidden
- channels.clickSponsoredMessage
- stories.sendStory
- stories.editStory
- stories.deleteStories
- stories.togglePinned
- stories.getAllStories
- stories.getUserStories
- stories.getPinnedStories
- stories.getStoriesArchive
- stories.getStoriesByID
- stories.toggleAllStoriesHidden
- stories.getAllReadUserStories
- stories.readStories
- stories.incrementStoryViews
- stories.getStoryViewsList
- stories.getStoriesViews
- stories.exportStoryLink
- stories.report
New Constructors:
- inputMediaStory
- messageMediaStory
- updateStory
- updateReadStories
- updateStoryID
- inputPrivacyKeyAbout
- privacyKeyAbout
- inputPrivacyValueAllowCloseFriends
- privacyValueAllowCloseFriends
- webPageAttributeStory
- messageReplyStoryHeader
- messagePeerVote
- messagePeerVoteInputOption
- messagePeerVoteMultiple
- sponsoredWebPage
- storyViews
- storyItemDeleted
- storyItemSkipped
- storyItem
- userStories
- stories.allStoriesNotModified
- stories.allStories
- stories.stories
- stories.userStories
- storyView
- stories.storyViewsList
- stories.storyViews
- inputReplyToMessage
- inputReplyToStory
- exportedStoryLink
Changed Constructors:
Added close_friend param to user
Added stories_hidden param to user
Added stories_unavailable param to user
Added stories_max_id param to user
Added alt_document param to messageMediaDocument
Added stories_muted param to inputPeerNotifySettings
Added stories_hide_sender param to inputPeerNotifySettings
Added stories_sound param to inputPeerNotifySettings
Added stories_muted param to peerNotifySettings
Added stories_hide_sender param to peerNotifySettings
Added stories_ios_sound param to peerNotifySettings
Added stories_android_sound param to peerNotifySettings
Added stories_other_sound param to peerNotifySettings
Added stories_pinned_available param to userFull
Added stories param to userFull
Added peer param to updateMessagePollVote
Removed user_id param from updateMessagePollVote
Added nosound param to documentAttributeVideo
Added preload_prefix_size param to documentAttributeVideo
Added stories_preload param to autoDownloadSettings
Added small_queue_active_operations_max param to autoDownloadSettings
Added large_queue_active_operations_max param to autoDownloadSettings
Added chats param to messages.votesList
Added keep_archived_unmuted param to globalPrivacySettings
Added keep_archived_folders param to globalPrivacySettings
Added webpage param to sponsoredMessage
Added my param to messagePeerReaction
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
MadelineProto was updated (8.0.0-beta115)!
Features:
- You can now get direct download links for or directly download stories, check out the open-source MadelineProto-based @tgstories_dl_bot to download any Telegram story!
- Added support for
-
-
- Added
- Improved IDE typehinting.
- CLI bots: you can now optionally specify a default download link URL (used by
- Added
Fixes:
- Fixed simple filters with service messages.
- Fixed IDE typehinting for
- Fixed startAndLoopMulti.
- Tweaked the default drop timeout on media DCs to avoid timeout errors on slow networks.
- Now the admin list only contains user report peers.
- Make
- Fixed
Features:
- You can now get direct download links for or directly download stories, check out the open-source MadelineProto-based @tgstories_dl_bot to download any Telegram story!
- Added support for
parse_mode parsing for story methods.-
getReply now simply returns null if the message doesn't reply to any other message.-
getReply now has an optional parameter that can be used to filter the returned message type.- Added
isSelfUser(), isSelfBot() messages to check whether the current user is a user or a bot.- Improved IDE typehinting.
- CLI bots: you can now optionally specify a default download link URL (used by
getDownloadLink) in the settings.- Added
DialogMessagePinned service message with a getPinnedMessage() method.Fixes:
- Fixed simple filters with service messages.
- Fixed IDE typehinting for
getEventHandler.- Fixed startAndLoopMulti.
- Tweaked the default drop timeout on media DCs to avoid timeout errors on slow networks.
- Now the admin list only contains user report peers.
- Make
markdownEscape method accessible.- Fixed
getDownloadLink for non-event-handler web IPC instances.GitHub
MadelineProto/examples/tgstories_dl_bot.php at v8 · danog/MadelineProto
Async PHP client API for the telegram MTProto protocol - danog/MadelineProto
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
You can now download any Telegram Story using @tgstories_dl_bot!
Just send it a /dlStory @username command, and it will generate download links for all stories on the user's profile!
@tgstories_dl_bot is powered by @MadelineProto, and it's fully open source!
Just send it a /dlStory @username command, and it will generate download links for all stories on the user's profile!
@tgstories_dl_bot is powered by @MadelineProto, and it's fully open source!
GitHub
MadelineProto/examples/tgstories_dl_bot.php at v8 · danog/MadelineProto
Async PHP client API for the telegram MTProto protocol - danog/MadelineProto
MadelineProto | Official Channel
You can now download any Telegram Story using @tgstories_dl_bot! Just send it a /dlStory @username command, and it will generate download links for all stories on the user's profile! @tgstories_dl_bot is powered by @MadelineProto, and it's fully open source!
This userbot is powered by MadelineProto!
Telegram
MadelineProto | Official Channel
Official MadelineProto channel.
Italian Channel: @MadelineProtoIta
Group: @pwrtelegramgroup
Italian Channel: @MadelineProtoIta
Group: @pwrtelegramgroup
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
As a birthday present for Telegram's 🥳 th birthday, MadelineProto now supports VoIP calls again!
Try calling the Magna Luna webradio @magicalcrazypony to hear some cool songs, powered by @MadelineProto!
The new MadelineProto VoIP implementation is written in pure PHP, so it works even on free webhosts!
Check out the new VoIP documentation for more info on how to write your very own Telegram webradio using MadelineProto!
Features (8.0.0-beta131):
- VoIP calls!
- You can now
- You can now
- Added a
- Updated to layer 161!
New Methods:
- contacts.setBlocked
- stories.activateStealthMode
- stories.sendReaction
Changed Methods:
Added my_stories_from param to contacts.block
Added my_stories_from param to contacts.unblock
Added my_stories_from param to contacts.getBlocked
Added media_areas param to stories.sendStory
Added media_areas param to stories.editStory
Added just_contacts param to stories.getStoryViewsList
Added reactions_first param to stories.getStoryViewsList
Added q param to stories.getStoryViewsList
Added offset param to stories.getStoryViewsList
Removed offset_date param from stories.getStoryViewsList
Removed offset_id param from stories.getStoryViewsList
New Constructors:
- updateStoriesStealthMode
- updateSentStoryReaction
- storiesStealthMode
- mediaAreaCoordinates
- mediaAreaVenue
- inputMediaAreaVenue
- mediaAreaGeoPoint
Changed Constructors:
Added blocked_my_stories_from param to userFull
Added blocked_my_stories_from param to updatePeerBlocked
Added reactions_count param to storyViews
Added media_areas param to storyItem
Added sent_reaction param to storyItem
Added stealth_mode param to stories.allStoriesNotModified
Added stealth_mode param to stories.allStories
Added blocked param to storyView
Added blocked_my_stories_from param to storyView
Added reaction param to storyView
Added reactions_count param to stories.storyViewsList
Added next_offset param to stories.storyViewsList
Fixes:
- Greatly improved performance by deferring all ORM operations!
- CDN fixes!
- Fix connection to the database when a password is accidentally provided but none is needed
- Removed all generator polyfilling code and deprecated generator functions!
As a side note, I'm very happy of how the current VoIP implementation turned out, and it was a lot of fun to write!
Adding native webhost support required me to write a pure PHP OGG OPUS muxer and demuxer, as well as a full reimplementation of the GrVP protocol in pure PHP: doing it in such a high-level language allowed me to easily use amphp's libraries to easily add support for URLs, streams and all audio formats.
I also wrote a PHP FFI wrapper for libopus for this project, I'll probably split it to a separate package along with the OGG muxer/demuxer because it's really useful :)
Try calling the Magna Luna webradio @magicalcrazypony to hear some cool songs, powered by @MadelineProto!
The new MadelineProto VoIP implementation is written in pure PHP, so it works even on free webhosts!
Check out the new VoIP documentation for more info on how to write your very own Telegram webradio using MadelineProto!
Features (8.0.0-beta131):
- VoIP calls!
- You can now
play() audio files of any format, local files, stream URLs or even stream data using AMP streams!- You can now
play() audio files even on webhosts, by pre-converting the files using @libtgvoip_bot!- Added a
downloadToReturnedStream method!- Updated to layer 161!
New Methods:
- contacts.setBlocked
- stories.activateStealthMode
- stories.sendReaction
Changed Methods:
Added my_stories_from param to contacts.block
Added my_stories_from param to contacts.unblock
Added my_stories_from param to contacts.getBlocked
Added media_areas param to stories.sendStory
Added media_areas param to stories.editStory
Added just_contacts param to stories.getStoryViewsList
Added reactions_first param to stories.getStoryViewsList
Added q param to stories.getStoryViewsList
Added offset param to stories.getStoryViewsList
Removed offset_date param from stories.getStoryViewsList
Removed offset_id param from stories.getStoryViewsList
New Constructors:
- updateStoriesStealthMode
- updateSentStoryReaction
- storiesStealthMode
- mediaAreaCoordinates
- mediaAreaVenue
- inputMediaAreaVenue
- mediaAreaGeoPoint
Changed Constructors:
Added blocked_my_stories_from param to userFull
Added blocked_my_stories_from param to updatePeerBlocked
Added reactions_count param to storyViews
Added media_areas param to storyItem
Added sent_reaction param to storyItem
Added stealth_mode param to stories.allStoriesNotModified
Added stealth_mode param to stories.allStories
Added blocked param to storyView
Added blocked_my_stories_from param to storyView
Added reaction param to storyView
Added reactions_count param to stories.storyViewsList
Added next_offset param to stories.storyViewsList
Fixes:
- Greatly improved performance by deferring all ORM operations!
- CDN fixes!
- Fix connection to the database when a password is accidentally provided but none is needed
- Removed all generator polyfilling code and deprecated generator functions!
As a side note, I'm very happy of how the current VoIP implementation turned out, and it was a lot of fun to write!
Adding native webhost support required me to write a pure PHP OGG OPUS muxer and demuxer, as well as a full reimplementation of the GrVP protocol in pure PHP: doing it in such a high-level language allowed me to easily use amphp's libraries to easily add support for URLs, streams and all audio formats.
I also wrote a PHP FFI wrapper for libopus for this project, I'll probably split it to a separate package along with the OGG muxer/demuxer because it's really useful :)
Please open Telegram to view this post
VIEW IN TELEGRAM
docs.madelineproto.xyz
Telegram VoIP phone calls
MadelineProto provides an easy wrapper to work with phone calls.
Forwarded from Daniil Gentili's news channel (Daniil Gentili)
I'm very happy to announce the first release of https://github.com/danog/php-tokio: you can now use any async Rust library from PHP!
It's fully integrated with revolt: this allows full compatibility with amphp, PSL and reactphp, and with any Rust library powered by tokio.rs.
Here's an example from the repo, using the async Rust reqwest library to make asynchronous HTTP requests from PHP:
I've created this library because I'm building an async MongoDB client for PHP (https://github.com/Nicelocal/mongo-php-async-driver), and realized that using the official rust mongodb library directly from PHP would be way easier (and faster!) than writing a MongoDB client in pure PHP :)
P.S. Here's the link to the hackernews thread I created for the occasion :)
https://news.ycombinator.com/item?id=37285471
It's fully integrated with revolt: this allows full compatibility with amphp, PSL and reactphp, and with any Rust library powered by tokio.rs.
Here's an example from the repo, using the async Rust reqwest library to make asynchronous HTTP requests from PHP:
<?phpI'm really excited for the potential usecases of php-tokio, and its implications for the PHP async ecosystem.
use Reqwest\Client;
use function Amp\async;
use function Amp\Future\await;
require 'vendor/autoload.php';
Client::init();
function test(int $delay): void {
$url = "https://httpbin.org/delay/$delay";
$t = time();
echo "Making async reqwest to $url that will return after $delay seconds...".PHP_EOL;
Client::get($url);
$t = time() - $t;
echo "Got response from $url after ~".$t." seconds!".PHP_EOL;
};
$futures = [];
$futures []= async(test(...), 5);
$futures []= async(test(...), 5);
$futures []= async(test(...), 5);
await($futures);
I've created this library because I'm building an async MongoDB client for PHP (https://github.com/Nicelocal/mongo-php-async-driver), and realized that using the official rust mongodb library directly from PHP would be way easier (and faster!) than writing a MongoDB client in pure PHP :)
P.S. Here's the link to the hackernews thread I created for the occasion :)
https://news.ycombinator.com/item?id=37285471
GitHub
GitHub - danog/php-tokio: Use any async Rust library from PHP!
Use any async Rust library from PHP! Contribute to danog/php-tokio development by creating an account on GitHub.
Forwarded from Daniil Gentili's news channel (Daniil Gentili)
I'm very happy to announce the first release of https://github.com/danog/php-tokio: you can now use any async Rust library from PHP!
It's fully integrated with revolt: this allows full compatibility with amphp, PSL and reactphp, and with any Rust library powered by tokio.rs.
Here's an example from the repo, using the async Rust reqwest library to make asynchronous HTTP requests from PHP:
I've created this library because I'm building an async MongoDB client for PHP (https://github.com/Nicelocal/mongo-php-async-driver), and realized that using the official rust mongodb library directly from PHP would be way easier (and faster!) than writing a MongoDB client in pure PHP :)
It's fully integrated with revolt: this allows full compatibility with amphp, PSL and reactphp, and with any Rust library powered by tokio.rs.
Here's an example from the repo, using the async Rust reqwest library to make asynchronous HTTP requests from PHP:
<?phpI'm really excited for the potential usecases of php-tokio, and its implications for the PHP async ecosystem.
use Reqwest\Client;
use function Amp\async;
use function Amp\Future\await;
require 'vendor/autoload.php';
Client::init();
function test(int $delay): void {
$url = "https://httpbin.org/delay/$delay";
$t = time();
echo "Making async reqwest to $url that will return after $delay seconds...".PHP_EOL;
Client::get($url);
$t = time() - $t;
echo "Got response from $url after ~".$t." seconds!".PHP_EOL;
};
$futures = [];
$futures []= async(test(...), 5);
$futures []= async(test(...), 5);
$futures []= async(test(...), 5);
await($futures);
I've created this library because I'm building an async MongoDB client for PHP (https://github.com/Nicelocal/mongo-php-async-driver), and realized that using the official rust mongodb library directly from PHP would be way easier (and faster!) than writing a MongoDB client in pure PHP :)
GitHub
GitHub - danog/php-tokio: Use any async Rust library from PHP!
Use any async Rust library from PHP! Contribute to danog/php-tokio development by creating an account on GitHub.
PWRTelegram API channel pinned «I'm very happy to announce the first release of https://github.com/danog/php-tokio: you can now use any async Rust library from PHP! It's fully integrated with revolt: this allows full compatibility with amphp, PSL and reactphp, and with any Rust library…»
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
MadelineProto was updated!
8.0.0 is the first stable release of MadelineProto v8!
For the full changelog, see the messages on the official MadelineProto channel, starting from here!
Here are the main highlights:
- Amp v3 & revolt (fibers) support!
- A new simplified, stable and object-oriented event handler API based on filters and plugins!
- New sendVideo, sendAudio, sendDocument, etc methods with automatic metadata extraction via ffmpeg.
- A new getDownloadLink method for files up to 4gb!
- A new broadcast API, that can be used to asynchronously broadcast messages to all users of a bot or userbot in the background, automatically fetching all users of the bot!
- A pure PHP async VoIP implementation to make Telegram voice calls even on limited webhosts!
- An official docker image!
- Built-in static analysis of event handler code!
- Major performance and stability improvements!
- Many other new features and UX improvements, see all messages starting from https://xn--r1a.website/MadelineProto/591 for more info!
Major parts of the MadelineProto core were split into standalone libraries that can be used without requiring all of MadelineProto:
- https://github.com/danog/AsyncOrm - Async ORM based on AMPHP v3 and fibers.
- https://github.com/danog/telegram-entities - A library to work with Telegram UTF-16 styled text entities.
- https://github.com/danog/tg-file-decoder - A library to work with Telegram bot API file IDs (recently updated).
The next releases will focus on even more features and performance improvements, such as prometheus and grafana statistics, a static TL parser and much, much more!
Cheers!
8.0.0 is the first stable release of MadelineProto v8!
For the full changelog, see the messages on the official MadelineProto channel, starting from here!
Here are the main highlights:
- Amp v3 & revolt (fibers) support!
- A new simplified, stable and object-oriented event handler API based on filters and plugins!
- New sendVideo, sendAudio, sendDocument, etc methods with automatic metadata extraction via ffmpeg.
- A new getDownloadLink method for files up to 4gb!
- A new broadcast API, that can be used to asynchronously broadcast messages to all users of a bot or userbot in the background, automatically fetching all users of the bot!
- A pure PHP async VoIP implementation to make Telegram voice calls even on limited webhosts!
- An official docker image!
- Built-in static analysis of event handler code!
- Major performance and stability improvements!
- Many other new features and UX improvements, see all messages starting from https://xn--r1a.website/MadelineProto/591 for more info!
Major parts of the MadelineProto core were split into standalone libraries that can be used without requiring all of MadelineProto:
- https://github.com/danog/AsyncOrm - Async ORM based on AMPHP v3 and fibers.
- https://github.com/danog/telegram-entities - A library to work with Telegram UTF-16 styled text entities.
- https://github.com/danog/tg-file-decoder - A library to work with Telegram bot API file IDs (recently updated).
The next releases will focus on even more features and performance improvements, such as prometheus and grafana statistics, a static TL parser and much, much more!
Cheers!
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
MadelineProto was updated!
MadelineProto 8.1.0 introduces an official Grafana dashboard for MadelineProto, powered by danog/better-prometheus!
See here for more info on how to configure the Prometheus metrics endpoint and Grafana dashboard!
Features:
- Official grafana dashboard, powered by danog/better-prometheus!
- Extract bot API dialog ID handling logic into a separate library, danog/tg-dialog-id!
- Add a previously missing
- Add messages.getEmojiStickerGroups method!
Fixes:
- Fix a possible bug in sendVideo
- Fix a possible bug in parseMode parsing
- Fix SecretMessage::delete
- Fix passing of seekable streams to IPC methods
- Other minor bugfixes
- Performance improvements
MadelineProto 8.1.0 introduces an official Grafana dashboard for MadelineProto, powered by danog/better-prometheus!
See here for more info on how to configure the Prometheus metrics endpoint and Grafana dashboard!
Features:
- Official grafana dashboard, powered by danog/better-prometheus!
- Extract bot API dialog ID handling logic into a separate library, danog/tg-dialog-id!
- Add a previously missing
$deleteHistory flag to discardSecretChat!- Add messages.getEmojiStickerGroups method!
Fixes:
- Fix a possible bug in sendVideo
- Fix a possible bug in parseMode parsing
- Fix SecretMessage::delete
- Fix passing of seekable streams to IPC methods
- Other minor bugfixes
- Performance improvements
docs.madelineproto.xyz
Metrics
MadelineProto can expose many useful metrics, that can be visualized using the official MadelineProto Grafana dashboard.
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
Forwarded from Daniil Gentili
Happy to announce I've launched a blog, where I'll be posting news about all my different projects, MadelineProto, Psalm, and much more: blog.daniil.it!
I now also have a newsletter, feel free to subscribe to receive all the latest news: blog.daniil.it/newsletter ❤️
All posts posted to my blog and newsletter will also be posted here (replacing the old @daniilgentili blog for technical reasons, as I do not have access to the owner account anymore).
You can now discuss posts news about *all* my projects in the linked discussion group: here!
I now also have a newsletter, feel free to subscribe to receive all the latest news: blog.daniil.it/newsletter ❤️
All posts posted to my blog and newsletter will also be posted here (replacing the old @daniilgentili blog for technical reasons, as I do not have access to the owner account anymore).
You can now discuss posts news about *all* my projects in the linked discussion group: here!
Forwarded from Daniil Gentili
The first series of posts I'll be adding here will be some technical deep dives into the performance improvements I've made in Psalm v6, can't wait to share them all with you!
Forwarded from Daniil Gentili
Daniil Gentili
The first series of posts I'll be adding here will be some technical deep dives into the performance improvements I've made in Psalm v6, can't wait to share them all with you!
And then, a long overdue post about my Autonomous System (AS198747), and an over more overdue MadelineProto v9 :D
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
Introducing MadelineProto 8.8.8, with video calls, group calls, livestreams and end-to-end encrypted conference calls, all in pure PHP, absolutely NO ffmpeg or extensions: all group/conference call and video call functionality works on webhosts, too!
Example:
See examples/bot.php for a full example!
See the call documentation » for more info, and try the open-source magnaluna video webradio », which plays a video (including youtube videos WITHOUT ffmpeg/yt-dlp, 100% webhost support) in one-to-one calls, in the video chats and conference calls whose links you send it, and in the video chats of all its groups!
Test the new features live with magnaluna on Telegram: @magicalcrazypony! Call it, send it /call, or send it the link of a group call or conference call to join, or use the /join command in a group to create or join a group call.
Features:
- Video calls: play WebM/MKV files with VP8, VP9, H.264, H.265 (or AV1, in one-to-one calls) video and OPUS audio into any call: frames are demuxed in pure PHP and sent as-is, with no transcoding. Start a video call with
- Screen sharing: play a video as a screen share alongside the camera stream with
- Group calls (video chats and livestreams): create (also scheduled and RTMP livestreams), join (also as a channel or via an invite link), stream audio and video, share the screen, record, and manage them: title, invites and invite links, muting, volume, raised hands, server-side recording, kicking participants, in-call messages and reactions.
- Livestreams: record stream mode livestreams (including RTMP ones), using the new pure PHP
- Live stories: start a live story with
- End-to-end encrypted conference calls: create them, join them via link or invitation, invite users, verify the key emojis, send end-to-end encrypted in-call messages and remove participants (rekeying the call), or upgrade a one-to-one call with
- Call recording:
- New
- All call types now implement the common
- New
- Messages have new
- Calls survive restarts: playlists (continuing the current WebM/OGG file where it left off), hold files (which now loop) and recordings are saved in the session.
- Resumable uploads: interrupted uploads of files, URLs, Telegram files and resumable streams (encrypted ones included) are resumed after a restart, without uploading the already uploaded parts again.
- Resumable method calls: interrupted method calls and
- Resumable download streams:
- Through IPC, calls without callbacks are sent again when the IPC server restarts.
- Added support for communities.
- Any OGG OPUS file (mono or stereo, with any frame size) can now be played into calls as-is, not only the ones created by MadelineProto: no more need to pre-convert them with
- Update to layer 231.
Fixes:
- Fix downloads without a size not closing the connection
- Fix
- Fix inline query button conversion in keyboard buttons
- Fix sending media with a TTL
- Upgrade to phpseclib 4, keeping sessions created with phpseclib 3 loadable
- File reference improvements
- Fix updates received while the event handler is starting being handled again in an endless loop, using all the memory, if the event handler failed to start
- Fix uploads with a cancellation through IPC, and IPC cancellations no longer block the event loop
- Fix encrypted downloads starting from a non-zero offset
- Cancelled uploads no longer throw errors into the event loop
The latest official MadelineProto phars are now downloadable through @madelineprotophar as well.
Full TL changelog: https://github.com/danog/MadelineProto/releases/tag/8.8.8
Example:
<?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();
$MadelineProto->requestCall('@username', video: true)->play(new RemoteUrl('https://paste.daniil.it/oncall.webm'));
$MadelineProto->joinGroupCall('@mygroup')->play(new RemoteUrl('https://paste.daniil.it/oncall.webm'));
See examples/bot.php for a full example!
See the call documentation » for more info, and try the open-source magnaluna video webradio », which plays a video (including youtube videos WITHOUT ffmpeg/yt-dlp, 100% webhost support) in one-to-one calls, in the video chats and conference calls whose links you send it, and in the video chats of all its groups!
Test the new features live with magnaluna on Telegram: @magicalcrazypony! Call it, send it /call, or send it the link of a group call or conference call to join, or use the /join command in a group to create or join a group call.
Features:
- Video calls: play WebM/MKV files with VP8, VP9, H.264, H.265 (or AV1, in one-to-one calls) video and OPUS audio into any call: frames are demuxed in pure PHP and sent as-is, with no transcoding. Start a video call with
requestCall($user, video: true).- Screen sharing: play a video as a screen share alongside the camera stream with
MediaDestination::Presentation.- Group calls (video chats and livestreams): create (also scheduled and RTMP livestreams), join (also as a channel or via an invite link), stream audio and video, share the screen, record, and manage them: title, invites and invite links, muting, volume, raised hands, server-side recording, kicking participants, in-call messages and reactions.
- Livestreams: record stream mode livestreams (including RTMP ones), using the new pure PHP
Mp4 demuxer, and publish RTMP livestreams with getGroupCallStreamRtmpUrl.- Live stories: start a live story with
startLive, stream into it, comment, and handle Telegram Stars donations.- End-to-end encrypted conference calls: create them, join them via link or invitation, invite users, verify the key emojis, send end-to-end encrypted in-call messages and remove participants (rekeying the call), or upgrade a one-to-one call with
migrateCallToConference.- Call recording:
setOutput records a participant's microphone, camera and screen share into a Matroska (or OGG OPUS) file with a fixed set of tracks, and setOutputFolder records every participant into a directory, starting a new file whenever their streams change. Recordings are written in pure PHP, without decoding anything.- New
CallStreams update, emitted whenever the streams a participant sends (or their codecs) change, and whenever a recording ends.- All call types now implement the common
Call interface (and the multi-party ones MultiCall), with the same playlist, mute, screen sharing and recording controls: PrivateCall (with VoIP kept as an alias), GroupCall, LiveStory and ConferenceCall.- New
GroupCall, GroupCallParticipants, GroupCallMessage, GroupCallMessagesDeleted, LiveStory, LiveStoryMessage and ConferenceCallMessage updates.- Messages have new
getCall, canRequestCall, requestCall and getCallDenialReason methods, to start (or get) the call of a private chat, or the video chat of a group or channel; CallNotAllowedException explains why a call can't be started. $message->requestCall()->join() works in every chat, since joining an outgoing one-to-one call does nothing.- Calls survive restarts: playlists (continuing the current WebM/OGG file where it left off), hold files (which now loop) and recordings are saved in the session.
- Resumable uploads: interrupted uploads of files, URLs, Telegram files and resumable streams (encrypted ones included) are resumed after a restart, without uploading the already uploaded parts again.
- Resumable method calls: interrupted method calls and
send* calls uploading such files are resumed after a restart, until their upload completes (can be disabled with the new resumeInterruptedCalls file setting).- Resumable download streams:
downloadToReturnedStream and Media::getStream now return a ResumableDownloadStream, which can be serialized, and resumes downloading from where it left off.- Through IPC, calls without callbacks are sent again when the IPC server restarts.
- Added support for communities.
- Any OGG OPUS file (mono or stereo, with any frame size) can now be played into calls as-is, not only the ones created by MadelineProto: no more need to pre-convert them with
@libtgvoip_bot or Ogg::convert.- Update to layer 231.
Fixes:
- Fix downloads without a size not closing the connection
- Fix
getInputClientProxy on null- Fix inline query button conversion in keyboard buttons
- Fix sending media with a TTL
- Upgrade to phpseclib 4, keeping sessions created with phpseclib 3 loadable
- File reference improvements
- Fix updates received while the event handler is starting being handled again in an endless loop, using all the memory, if the event handler failed to start
- Fix uploads with a cancellation through IPC, and IPC cancellations no longer block the event loop
- Fix encrypted downloads starting from a non-zero offset
- Cancelled uploads no longer throw errors into the event loop
The latest official MadelineProto phars are now downloadable through @madelineprotophar as well.
Full TL changelog: https://github.com/danog/MadelineProto/releases/tag/8.8.8