Official MadelineProto channel. Italian Channel: @MadelineProtoIta Group: @pwrtelegramgroup
Docs are still being built, the links should work in ~10 mins :)
Читать полностью…MadelineProto was updated (8.0.0-beta148)!
Fixes by @danogentili:
- Connection stability fixes
- Avoid GC bugs
- Improve media DC logic
- Fix sendDocument/sendPhoto through IPC API
- Fix upload of images with no content-length
- Fix usage of streams and filecallbacks through the IPC API
- Allow using fopen on php://memory in the SimpleEventHandler
- Improve stream upload logic
- Handle MSG_WAIT_FAILED errors
- Improve call queue
- Improve tests
- TL fix
- Avoid ext-psr conflict
- Bugfix for @libtgvoipbot
Fixes by @AhJXD:
- Handle sendMessageGamePlayAction
My pure PHP implementation of STUN is ready, the first pre-alpha version of the library is available at https://github.com/danog/stun!
This library is the first step in the creation of a pure PHP implementation of webrtc, specifically to work with Telegram's new WebRTC-based VoIP implementation used in group and video calls, even from shared PHP webhosts :)
MadelineProto was updated (8.0.0-beta144)!
Features:
- Add cb, offset and end parameters to Media::getStream
- Always run updateSettings if settings are passed to constructor.
This is a useful UX improvement, but it brings some additional overhead when using new \danog\MadelineProto\API
, so please remove (or pass null) the second $settings parameter passed to the API constructor once the instance is logged in.
Fixes:
- Multiple IPC fixes and improvements
- Avoid connecting to old DCs that the server told us to forget about.
- Performance improvements in the update handler.
I'm now the main maintainer of gojekyll, a ~30x faster Go port of Jekyll :)
I fell in love with gojekyll the first time I found it: it's incredibly fast, and it's currently powering the MadelineProto documentation!
When I first found it, the project was kind of abandoned with quite a few missing features: now, it has a lot less bugs, some new features, and most importantly it's much faster than it used to be, mostly thanks to my fork of the blackfriday markdown processor, which uses the golang bfchroma syntax highlighter instead of the extremely slow python pygmentize library :)
I'm now also a maintainer of osteele/liquid, the Go port of the Shopify Liquid template engine powering gojekyll.
I've released MadelineProto 8.0.0-beta136, it features many fixes, including fixes for proxies and a fix to avoid reporting the same error more than once in a minute.
Also, as mentioned in the previous post, I completely removed all deprecated APIs, including the legacy array settings and Generator polyfills.
These APIs were deprecated and due to be removed a long time ago, but in case you haven't switched over yet, here's a quick recap on how to upgrade:
- Update to php 8.1.17+ or php 8.2.4+ (PHP 8.2.9 is strongly recommended)
- Remove all calls to async(false), async(true), all yields and unwrap all code wrapped in loop(function ()...) blocks (because async is now always enabled by default, and you can use async functions without yield since php 8.1).
- Replace legacy loops with the new loop API from daniil.it/loop
- Replace array settings with object settings, for example for the API ID:
Before:$settings = ['app_info' => ['api_id' => 123456, 'api_hash' => 'xxx']];
After:$settings = (new \danog\MadelineProto\Settings\AppInfo) ->setApiId(124) ->setApiHash('xx');
See docs.madelineproto.xyz/docs/SETTINGS.html and docs.madelineproto.xyz for more info.
Finished writing my own OGG muxer in pure PHP, for easy conversion of songs to the maximum possible bitrate, for the best possible VoIP quality :)
Читать полностью…MadelineProto 8.0.0-beta130 was released!
Features:
- Add CallbackQuery
, ButtonQuery
, ChatButtonQuery
, InlineButtonQuery
, GameQuery
, ChatGameQuery
, InlineGameQuery
simple update classes with many useful properties and methods:
- $query->queryId
: Query ID
- $query->userId
: ID of the user that pressed the button
- $query->chatInstance
: Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
- $query->data
: for ButtonQuery
and subclasses, data associated with the callback button.
- $query->matches
: for ButtonQuery
and subclasses, regex matches, if a filter regex is present.
- $query->chatId
: for Chat*Query
classes, chat where the inline keyboard was sent.
- $query->messageId
: for Chat*Query
classes, message ID.
- $query->gameShortName
: for GameQuery
and subclasses, short name of a Game to be returned, serves as the unique identifier for the game
- $query->inlineMessageId
: for Inline*Query
and subclasses, inline message ID
- $query->editText(...)
: for Chat*Query
classes, edits the message's text.
- $query->answer(string $message, bool $alert = false, ?string $url = null, int $cacheTime = 5 * 60)
- Answer an inline query
- Add translate
and editText
methods to Message
class
- Add FilterButtonQueryData
filter for ButtonQuery
- Adapt FilterFromAdmin
and FilterRegex
filter for ButtonQuery
- Add FromAdminOrOutgoing
simple filter
- Add markdownUrlEscape
method!
Fixes:
- Fix usage of inputMediaPhotoExternal
and inputMediaDocumentExternal
with messages.sendMultiMedia
, messages.sendMedia
, messages.uploadMedia
- Fix IsReplyToSelf
simple filter
- Fix CustomEmoji
media type
- Fix bot API conversion for messages forwarded from private channels (+ other bot API conversion fixes)
- Fix pagination hash generation
- Improve markdownCodeblockEscape
method
- Properly terminate IPC worker and delete session in case of session revocation
- Fix CDN file downloads
- Fix connection to testmode
- Properly wait when making getPwrChat requests
- Many other fixes!
MadelineProto was updated (8.0.0-beta126)!
Features:
- Add addReaction
, delReaction
, getOurReactions, pin, unpin
bound Message methods by @J_A_V_A
Fixes:
- Allow inclusion of traits, interfaces in plugins
- Fix creation of sessions
MadelineProto was updated (8.0.0-beta121)!
Features:
- Added StaticSticker, AnimatedSticker, VideoSticker media classes.
Fixes:
- Fix localization of some error messages
- Make sure the event handler class is in scope before unserializing
- Other various fixes
I've released MadelineProto 8 beta 117!
Features:
- Add FilterTextCaseInsensitive filter
Fixes:
- Multiple file-related fixes
You can also post stories using MadelineProto, here's a simple example that reposts messages as stories: https://github.com/danog/MadelineProto/blob/v8/examples/bot.php#L164
$media can be an update a message or inputMedia constructor with a URL/file path just like the one accepted by sendMedia!
Another example:
$media = [
'_' => 'inputMediaUploadedPhoto',
'file' => 'faust.jpg'
];
$MadelineProto->stories->sendStory(
media: $media,
caption: "This story was posted using [MadelineProto](/channel/MadelineProto)!",
parse_mode: ParseMode::MARKDOWN,
privacy_rules: [['_' => 'inputPrivacyValueAllowAll']]
);
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!
You can subscribe to my stories and add @danogentili as a contact to receive early updates about my projects ❤️
Читать полностью…MadelineProto 8.0.0-beta110 was released!
Fixes:
- Fix thumbnail parsing
- Fix parsing of round videos in some conditions
- Fix content-type/extension of getDownloadLink/downloadToBrowser
Also, check out the farsi channel for a translation of all the posts describing the features of MadelineProto 8.0.0-beta100+!
به کانال فارسی مدلین برای دیدن توضیحات تمام ویژگی های MadelineProto 8.0.0-beta100+ سر بزنید!
/channel/MadeLine_Farsi/3917
MadelineProto was updated (8.0.0-beta150)!
New Methods:
- bots.canSendMessage
- bots.allowSendMessage
- bots.invokeWebViewCustomMethod
- stories.canSendStory
Changed Constructors:
- Added from_request param to messageActionBotAllowed
- Added verified param to chatInvite
- Added scam param to chatInvite
- Added fake param to chatInvite
- Added has_viewers param to storyViews
Fixes:
- File-related fixes
MadelineProto was updated (8.0.0-beta145)!
Huge thanks to @madbyte and @J_A_V_A for contributing a huge number of abstractions for the SimpleEventHandler for this release, here's the full changelog:
Features by @madbyte:
- Add InlineQuery
SimpleEventHandler updates with related classes
- Add block
, unblock
, read
, enableTTL
, disableTTL
, getStories
, setAction
, enableTTL
, disableTTL
bound methods to all message updates (with related classes)
- Add Story
, StoryReaction
, ChannelUserTyping
, UserTyping
, Blocked
, BotStopped
, Phone
, Status
, Username
, Privacy
SimpleEventHandler updates
- Add save
, unsave
bound methods to the Gif
class
- Add disableSignatures
, enableSignatures
, getMember
, hideHistory
, unhideHistory
bound methods to ChannelMessage
- Add getMember
, hideMembers
, unhideMembers
, hideHistory
, unhideHistory
, deleteUserMessages
, toSuperGroup
, enableAntiSpam
, disableAntiSpam
, enableTopics
, disableTopics
, createTopic
, editTopic
, openTopic
, closeTopic
, deleteTopic
bound methods to GroupMessage
- Add Participant
and AdminRights
, BannedRights
classes
- Add screeshot
bound method to PrivateMessage
- Add DialogChannelCreated
, DialogChannelMigrateFrom
, DialogChatJoinedByLink
, DialogChatMigrateTo
, DialogContactSignUp
, DialogGameScore
, DialogGeoProximityReached
, DialogGiftPremium
, GroupCallEnded
, GroupCallInvited
, GroupCallScheduled
, DialogHistoryCleared
, DialogMemberJoinedByRequest
, DialogPeerRequested
, DialogPhoneCall
, DialogScreenshotTaken
, DialogSetChatTheme
, DialogSetTTL
, DialogSuggestProfilePhoto
, DialogTopicCreated
, DialogTopicEdited
, DialogWebView
SimpleEventHandler service messages
- Add Privacy
abstraction
Features by @J_A_V_A:
- Add entity support for SimpleEventHandler Message
s, with full OOP Entity abstractions
- Add ButtonQuery
updates
- Add downloadToDir
, downloadToFile
bound methods to Media
objects
- Add report
, saveContact
, removeContact
, inviteToChannel
, read
bound methods to Message
objects
- Add view
bound method to ChannelMessage
- Add ban
, unban
, kick
, deleteAll
methods to GroupMessage
- Begin work on secret chat support for SimpleEventHandler
Features by @danogentili:
- Add support for bot API secret chat IDs
- Begin work on group call and video call support
- Add view/forward/author information in forwarded messages
- Increase performance with buffered logging
- Add isBot
method, to check if the specified peer is a bot.
- Add FilterFromBot
, FilterSenders
filters
Fixes by @danogentili:
- Completely refactored the connection module, featuring:
- 60-80% faster initial handshakes
- No unneeded socket connections to unused DCs
- Automatic disconnection of inactive media sockets
- Properly reconnect in case of network issues (fixes "Request Timeout" errors)
- Optimizations across the board
- Add pcntl extension to docker image
- Mark all optional constructor parameters as optional in the public API.
- Fix usage of boolean parameters of account.changeAuthorizationSettings, messages.editExportedChatInvite, channels.editForumTopic, phone.toggleGroupCallSettings, phone.toggleGroupCallRecord, phone.editGroupCallParticipant
- Fix pagination in messages.getChatInviteImporters
by explicitly requiring the offset_date
parameter if offset_user
is provided
- Secret chat fixes
- Fix fileGetContents
and http-client
- Fix reuploading of media files from abstract Media objects
- Fix pending count in broadcasts
- Avoid race condition during initialization
- Avoid integer overflow in VoIP module
- FIx setBindTo
Fixes by @xtrime:
- Fix safari video streaming
Breaking changes:
- Moved the isSupergroup, toSupergroup, fromSupergroup methods to a DialogId class, which also has many other useful methods to work with bot API IDs.
- All download methods except for downloadToFile and downloadToDir now return null instead of true.
On a more personal note, I'm very happy of the changes that were contributed in this release: MadelineProto is an open source project, and you can contribute features as well, feel free to fork it and submit pull requests to add the features you think would be cool to have! :)
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:
<?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);
Aaaand we're on the front-page of hackernews ❤️❤️❤️
Читать полностью…MadelineProto was updated (8.0.0-beta138)!
Features:
- Added Outgoing
, FilterOutgoing
, Running
, FilterRunning
, Ended
, FilterEnded
filters and simple filters to allow filtering for outgoing, successfully configured or ended calls!
- Added VoIP::pause
/VoIP::resume
/VoIP::isPaused
methods for pausing/resuming currently playing files
- Add a getStream()
bound method to abstract Message objects!
- Allow uploading files directly from streams!
- Allow playing and converting VoIP audio from a stream (including any Telegram file with getStream()
!)
- Add source code of @libtgvoipbot
- Add VoIP::getCurrent()
method, to obtain the currently playing audio!
- Add a VoIP::getAllCalls()
method, to obtain all currently running calls indexed by user ID!
- Add a simple filter for broadcast progress updates
- Add Ogg::validateOgg
method
- Add Tools::getStreamPipe
method
- Add support for TCP VoIP streams
- Add ffmpeg to docker image
Fixes:
- Fix VoIP::skip()!
- Fix markdownUrlEscape!
- Fix the "Fix getIdFromUsername(): Return value must be of type ?int, string returned" issue that popped up when using the MySQL ORM
- Fixed many small VoIP issues!
Notice: MadelineProto v7 is now fully deprecated due to Telegram server-side changes, it cannot be used anymore, please switch to MadelineProto v8.
For this purpose, I've created a page to help in the conversion of your bots from MadelineProto v7 to MadelineProto v8, check it out!
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 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 :)
P. S. It seems like the official Telegram iOS app has a bug which prevents magnaluna from working properly, I'm looking into it, try calling from your Mac/Android/PC, instead!
VoIP calls are working again!
They will be released in the next beta, Magna Luna will also come back to life very soon ;)
P.S. This is done using a pure PHP implementation of VoIP, so it'll work even on webhosts ;)
And here comes beta127 with multiple fixes and improvements to plugins and error handling!
Читать полностью…beta123 adds a FilterFromSender filter (single version of FilterFromSenders), fixes some issues, and disables non-IPC fallback mode, which could have led to long IPC startup times in certain edge conditions.
Читать полностью…beta120 includes multiple UX improvements, such as:
- Event handler attribute validation
- Warnings about missing extensions and MadelineProto updates in the login UI
And various fixes:
- Improve renaming using bot API file IDs and sendDocument/sendPhoto
- Improve getReply
- Fix the HTTP/HTTPS/WS/WSS transports
- Various file-related fixes
MadelineProto 8 beta 116 fixes a few issues with updateSettings, getReply and FilterReplyToSelf!
Читать полностью…P. S. It works for protected stories as well :)
Читать полностью…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 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.
MadelineProto supports 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
Click here to start using Telegram Stories in MadelineProto!
beta109 brings some additional fixes and allows passing a class name to getEventHandler!
Читать полностью…