PWRTelegram API channel


Гео и язык канала: Иран, Фарси
Категория: не указана


Official channel for the PWRTelegram bot API.
Installation instructions: https://pwrtelegram.xyz
Creator: @danogentili
Official support group: @pwrtelegramgroup
Italian channel: @pwrtelegramita
Source code: https://github.com/pwrtelegram

Связанные каналы

Гео и язык канала
Иран, Фарси
Категория
не указана
Статистика
Фильтр публикаций


Репост из: Daniil Gentili's news channel
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:


Репост из: Daniil Gentili's news channel
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:


Репост из: MadelineProto | Official Channel
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 :)




Репост из: 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!


Репост из: MadelineProto | Official Channel
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 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


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 | 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 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:


Репост из: 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 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:


Репост из: MadelineProto | Official Channel
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!


Репост из: 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 file:


Репост из: MadelineProto | Official Channel
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 post for examples!

Other features:
- Thanks to the many translation contributors @ https://weblate.madelineproto.xyz/, MadelineProto is now localized in Hebrew, Persian, Kurdish, Uzbek, Russian, French and Italian!
- Added simplified sendMessage, sendDocument, sendPhoto methods that return abstract Message objects with simplified properties and bound methods!
- You can now use Tools::callFork to fork a new green thread!
- You can now automatically pin messages broadcasted using broadcastMessages, broadcastForwardMessages by using the new pin: true parameter!
- You can now use sendMessageToAdmins to send messages to the bot's admin (the peers returned by getReportPeers).
- Added wrapUpdate, wrapMessage, wrapMedia methods to wrap low-level MTProto updates into an abstracted Message object with bound methods!
- The waveform attribute of Voice objects is now automatically encoded and decoded to an array of 100 integer values!
- Added a custom PeerNotInDbException class for "This peer is not present in the internal peer database" errors
- Added a label property to the Button class, directly indicating the button label (instead of manually fetching it as an array key).
- Added isForum method to check whether a given supergroup is a forum
- Added an entitiesToHtml method to convert a message and a set of Telegram entities to an HTML string!
- You can now use reportMemoryProfile() to generate and send a pprof memory profile to all report peers to debug the causes of high memory usage.
- Added support for pay, loginurl, webapp and tg://user?id= buttons in bot API syntax!
- Added a getAdminIds function that returns the IDs of the admin of the bot (equal to the peers returned by getReportPeers in the event handler).
- Added a new ParseMode enum!
- Added support for HTML lists in parseMode!
- Fixed parsing of markdown code blocks!

Breaking changes:
- Switched to a custom markdown parser with bot API MarkdownV2 syntax, which differs from the previous Markdown syntax supported by parsedown.
- Markdown text can't contain HTML anymore.

Fixes:
- Fixed file uploads with ext-uv!
- Fixed file re-uploads!
- Improve background broadcasting with the broadcast API using a pre-defined list of whitelist IDs!
- Fixed a bug that caused updates to get paused if an exception is thrown during onStart.
- Broadcast IDs are now unique across multiple broadcasts, even if previous broadcasts already completed their ID will never be re-used.
- Now uploadMedia, sendMedia and upload can upload files from string buffers created using ReadableBuffer.
- Reduced memory usage during flood waits by tweaking config defaults.
- Reduced memory usage by clearing the min database automatically as needed.
- Automatically try caching all dialogs if a peer not found error is about to be thrown.
- Fixed some issues with pure phar installs.
- Fixed splitting of HTML and markdown messages
- Fixed formatting of multiline markdown codeblocks
- And many other performance improvements and bugfixes!


Репост из: MadelineProto | Official Channel
MadelineProto now offers a simple broadcast API, that can be used to asynchronously broadcast messages to all users of a bot or userbot in the background, without incurring in timeouts or other issues.

Note that unlike the bot API, MadelineProto can be used to fetch the full list of users, chats and channels of a normal bot, simply using its bot token.

Here's a simple example, explaining how to broadcast a message and a photo to every user of a bot:


Репост из: MadelineProto | Official Channel
Introducing MadelineProto 7!

This update is mandatory for all MadelineProto users.

Due to 64-bit user IDs and Telegram's new API TOS, starting from January 1, 2022, old MadelineProto instances will stop working completely: even now, legacy instances can't login due to UPDATE_APP_TO_LOGIN errors.

If you're using MadelineProto 1 through 6, visit the releases page to view changelogs and upgrade tips.
You can also open an issue or visit the support group if you encounter issues while upgrading.

For most usecases, no changes are needed: however, graphical clients based on MadelineProto must implement sponsored messages.

Features:
- MadelineProto 7 provides a simple cached API to work with sponsored messages:
=> getSponsoredMessages
Get sponsored messages for channel, returns a list of sponsored message objects.
=> viewSponsoredMessage
Mark sponsored message as read.

Clients must then handle fetched sponsored messages as described in the API documentation.

- Layer 135! See the API documentation for a list of changed methods and constructors in layer 131-133.
Changes in layer 133-135:

Added methods:
- account.setAuthorizationTTL
- account.changeAuthorizationSettings
- messages.getSearchResultsCalendar
- messages.getSearchResultsPositions
- messages.hideChatJoinRequest
- messages.hideAllChatJoinRequests
- messages.toggleNoForwards
- messages.saveDefaultSendAs
- channels.getSendAs

Changed methods:
Renamed channels.deleteUserHistory to channels.deleteParticipantHistory; the old method still works.
Added base_theme param to account.installTheme
Added min_date, max_date params to messages.deleteHistory
Added send_as param to messages.sendMessage, messages.sendMedia, messages.sendMultiMedia, messages.forwardMessages, messages.sendInlineBotResult
Added request_needed, title params to messages.exportChatInvite, messages.editExportedChatInvite
Added requested, q params to messages.getChatInviteImporters
Renamed user_id=>participant in channels.reportSpam


Changed Constructors
Added requests_pending param to chatFull
Added recent_requesters param to chatFull
Added requests_pending param to channelFull
Added recent_requesters param to channelFull
Added default_send_as param to channelFull
Added request_chat_broadcast param to peerSettings
Added request_chat_title param to peerSettings
Added request_chat_date param to peerSettings
Added private_forward_name param to userFull
Added authorization_ttl_days param to account.authorizations
Added request_needed param to chatInviteExported
Added requested param to chatInviteExported
Added title param to chatInviteExported
Added request_needed param to chatInvite
Added about param to chatInvite
Added via_request param to channelParticipantSelf

New Constructors
- messageActionChatJoinedByRequest
- updatePendingJoinRequests
- updateBotChatInviteRequester
- inputKeyboardButtonUserProfile
- keyboardButtonUserProfile
- channelAdminLogEventActionParticipantJoinByRequest
- channelAdminLogEventActionToggleNoForwards
- channelAdminLogEventActionSendMessage

- New simplified EventHandler::startAndLoop API!
- Added support for t.me/+ invite links!
- New sponsored message API!
- Improved DB ORM API, used for example in the event handler!
- New FFI-based prime.madelineproto.xyz factorization module!
- An all new thread-safe madeline.php autoupdater!
- PHP 8.1 support!
- Zend hashmaps are now periodically reallocated to clean up RAM!

Deprecations:
- Dropped 32-bit support.
Android users can install 64-bit builds of php using Termux.
Raspberry pi users can use a 64-bit distro like archlinuxarm.org.
- madeline.php supports only php 7.1+
- composer supports only php 8+ (7.1+ support coming back soon)

Fixes:
- Fixed a side-channel reported by Theo von Arx and Kenneth G. Paterson @ ETH Zürich.

Internal improvements:
- Many, many internal bugfixes and performance improvements!
- Switched to the new RSA-OAEP-based authkey flow.
- Native openssl integration for faster crypto!
- Removed loads of legacy 32-bit hacks, greatly improving performance!


Репост из: MadelineProto | Official Channel
> What is AMPHP (https://amphp.org)?

Amp is a non-blocking concurrency framework for PHP providing primitives to manage concurrency such as an event loop, promises, and asynchronous iterators.

> OK, in simpler words?

AMPHP is a high-performance, parallelized PHP library that allows you to write extremely fast, efficient programs that work in parallel using green threads.

> * b r a i n m e l t *

Y E S

———

MadelineProto is not written in PHP: MadelineProto is written using AMPHP.
What this means is that when you using MadelineProto (and async is enabled), all incoming messages are handled in parallel, each in a separate thread, even on webhosts.

This allow your bots to always be responsive, even while executing complex tasks.

However, it is vital that you also use AMPHP (not PHP!) when writing your bot.
What this means is that the following PHP functions and extensions cannot be used in MadelineProto bots (otherwise, all the benefits of AMPHP would be nullified): instead, you must use the correct AMPHP library (automatically included in madeline.php).

❌ file_get_contents
amphp/file for files, amphp/http-client and $MadelineProto->fileGetContents for URLs

❌ curl, guzzle
amphp/http-client is async, much faster than other libraries, and also supports HTTP/2!

❌ mysqli, PDO, sqlite
amphp/mysql supports both MySQL and SQLite backends, and is fully async!
❔You can also use amphp/postgres and amphp/redis for PostgreSQL and Redis!

❌ php-fpm
amphp/http-server is a high-performance async HTTP/2 server, that can be interfaced with MadelineProto to create file download servers!

❌ include, require
❓ Don't use this function very often, and most importantly, don't use it inside of the event handler code.
❔ You should use it only once on bot startup, or else when reloading the bot (plugin source coming soon!)

———

In short, AMPHP is an awesome framework for using async PHP in 2020: you can join the official Telegram support group @amphpchat if you have any questions or suggestions on what else to add to AMPHP!


Репост из: MadelineProto | Official Channel
I'm also announcing some updates for the MadelineProto social channels.

- Introducing separate OT chat groups, to allow chatting about tech, politics and memes.
- Introducing a new international MadelineProto support group, for MadelineProto help and support.
- Finally introducing the official MadelineProto meme channel, full of only the dankest based memes!
- Introducing an official discussion group for AMPHP, the async, high-performance parallelized PHP library!

Also, finally introducing an official farsi MadelineProto channel: @madeline_farsi.
This channel will post farsi translations of the posts sent on the main channel, along with MadelineProto sources, AMPHP tips and much more!

Also, check out the official arabic MadelineProto channel: @madelineArabic


Репост из: MadelineProto | Official Channel
MadelineProto was updated!
MadelineProto 5.1 introduces several new features aimed at slashing boilerplate and obliterating bugs.

Features:
* Native error reporting: all errors surfacing from the event handler or MadelineProto will be automatically reported to the admin of the bot!
* Support for bot API file IDs with the sendMedia and download* methods thanks to the new tg-file-decoder library (can also be used standalone!).
* Fixes for bot API object conversion, now you can convert MTProto results to bot API objects using the MTProtoToBotAPI method (and the other way around with BotAPIToMTProto)!

Slashing boilerplate!
* Use the new startAndLoop(EventHandler::class) method to automatically initialize MadelineProto, event handling, error reporting and the event loop, all in a single call!
* Use the new onStart method of the event handler to execute async operations on bot (re)startup!

New settings!
* Use the new async updateSettings and getSettings methods to change settings, the old $MadelineProto->settings behavior is not supported anymore.

New download methods: both methods support parallel downloads, resuming and partial downloads, all chosen automatically depending on headers!
* downloadToResponse downloads files to an async http-server: this is perfect for creating file download bots!
* downloadToBrowser downloads files directly to the browser.

Among other internal changes:
* yield from everything: all internal MadelineProto methods now use yield from for maximum performance!
* Packagist install reports! Now all MadelineProto downloads through madeline.php are reported to packagist!


!!! Thank you for 130.000 downloads !!!


Видео недоступно для предпросмотра
Смотреть в Telegram
🦄


I wish you all a very happy new year!
❤️❤️❤️

Показано 20 последних публикаций.

816

подписчиков
Статистика канала