TGViewer
Channel Public Channel
PWRTelegram API channel

PWRTelegram API channel

@pwrtelegram

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
Subscribers
728
Photos
12
Videos
1
Links
165

Showing posts older than #501 · Back to latest

Older Posts 20 shown
Post #500 792

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

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!
docs.madelineproto.xyz Plugins MadelineProto offers a native plugin system, based on event handlers!
Post #499 928

Forwarded from MadelineProto | Official Channel (Daniil Gentili 🇺🇦)

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:
<?php
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('bot.madeline');

// Works OK with both bots and userbots
$MadelineProto->start();

$id = $MadelineProto->broadcastMessages([
['message' => 'This broadcast is powered by @MadelineProto!'],
['message' => 'This media broadcast is powered by @MadelineProto!', 'media' => [
'_' => 'inputMediaUploadedPhoto',
'file' => 'https://docs.madelineproto.xyz/logo-hover.png'
]],
]);



You can also forward messages:

// Send messages, showing the "Forwarded from" header
$id = $MadelineProto->broadcastForwardMessages(
from_peer: 101374607,
ids: [1, 2, 3, 4],
drop_author: false,
);

// Send messages WITHOUT showing the "Forwarded from" header
$id = $MadelineProto->broadcastForwardMessages(
from_peer: 101374607,
ids: [1, 2, 3, 4],
drop_author: true,
);


The methods return an integer ID that can be used to:

- Get the current broadcast progress with getBroadcastProgress
- Cancel the broadcast using cancelBroadcast

Note that to avoid manually polling the progress, MadelineProto will also periodically emit updateBroadcastProgress updates to the event handler, containing a Progress object for all broadcasts currently in-progress.

Filtering is also available, as well as support for custom broadcast actions.

See here » for a full example of the broadcast API, and here » for the full documentation.
docs.madelineproto.xyz Broadcasting messages to all users MadelineProto can be used to broadcast messages to all users, chats and channels of a bot or userbot.
Post #498 3.65K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

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!
core.telegram.org Telegram API Terms of Service Terms of Service that all third-party client apps must comply with.
Post #497 6.37K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

> 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!
amphp.org Asynchronous Multitasking PHP Amp is a non-blocking concurrency library for PHP based on Revolt.
Post #496 3.98K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

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
Post #495 3.33K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

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 !!!
Post #494 4.2K
🦄
Post #493 3.93K
I wish you all a very happy new year!
❤️❤️❤️
Post #491 2.02K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

MadelineProto was updated to v5!

Introducing upload by URL, file renaming, parallelized downloads and uploads!

You can now use MadelineProto to rename Telegram files or upload them by URL: all uploads and downloads will be made 100% in parallel, 20 chunks at a time for maximum speed (value tweakable in the settings).
For more info, see the new file documentation.

Also introducing:
- Strictly typed, camelCase public API, now all methods can also be called in camelCase, with PHP type hinting for most parameters and return values.
- Full PHPDOC documentation for all the public API, for perfect documentation in your favorite IDE :)
- Several internal bugfixes, refactoring and general performance and stability improvements.
- Improved tests, to avoid backwards compatiblity issues with previous sessions when pushing.
- Clean composer dependencies, now you just have to require danog/madelineproto ^5.0 and nothing else in your composer.json!

Breaking changes:
- NONE :D; you don't have to change your code!
docs.madelineproto.xyz Uploading and downloading files MadelineProto provides fully parallelized wrapper methods to upload and download files that support bot API file ids, direct upload by URL and file renaming.
Post #490 1.59K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

This is not all: there are still some very cool projects I've yet to finalize and release, eventually you'll see them.

I wish you all a Merry Christmas, and a very happy new year!

❤️❤️❤️
Post #489 1.5K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

Finally, feel free to take a look at my submission to the TON contest: https://github.com/danog/toncontest

The repository contains well-documented code for multiple TON smart contracts, a testing suite based on the official TON validator, and a build toolchain for TON.
GitHub GitHub - danog/toncontest: My submission to the TON blockchain contest My submission to the TON blockchain contest. Contribute to danog/toncontest development by creating an account on GitHub.
Post #488 1.32K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

Instantiation

use danog\MadelineProto\TON\API;

$API = new API(
[
'logger' => [
'logger' => Logger::ECHO_LOGGER
]
]
);


Usage:

$API->async(true);
$API->loop(
function () use ($API) {
yield $API->connect(__DIR__.'/ton-lite-client-test1.config.json');
var_dump(yield $API->liteServer->getTime());
}
);


For a full overview of async in MadelineProtoTon, take a look at the MadelineProto async docs.

For a full list of methods that can be used, simply look at the PHPDOC suggestions in your favorite IDE, or take a look at the ---functions--- section of the lite TL scheme (HTML docs coming soon).

This API can be used to build web-facing HTTP APIs that query the TON blockchain (using the async http-server), off-chain elements for TON applications and so much more!

Since it's in PHP & integrated in MadelineProto, you can also use it in free webhosts (aka use the blockchain on 000webhost AAAAAAAAA ❤️❤️❤️❤️❤️)
docs.madelineproto.xyz Async MadelineProto now features async, for incredible speed improvements, and parallel processing, all powered by amphp.
Post #487 1.14K

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

Next, I am proud to announce support for the TON protocol in MadelineProto.

MadelineProto is now capable of integrating with the Telegram TON blockchain, thanks to a fully native implementation of ADNL and the lite-client protocol.

It allows async interaction with liteservers in the same manner as the official lite-client, only with way more abstractions and ease of use.
GitHub MadelineProto/ton at v8 · danog/MadelineProto Async PHP client API for the telegram MTProto protocol - danog/MadelineProto
Post #483 946

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

First of all, madelineTon.js:

A pure JS client-side implementation of the Telegram TON blockchain protocol.

Interact directly with the TON blockchain with no middlemans, directly from your browser!

This is possible thanks to a client-side implementation of the ADNL P2P protocol (whitepaper).
Connection to the liteservers is made through a simple websocket proxy that simply acts as a TCP <=> websocket proxy.

All cryptography is done exclusively in the browser, allowing fully secure interaction with the chosen TON node.

The client is fully asynchronous, making use of workers and/or browser webcrypto APIs for cryptography (curves & AES).

TL, ECC w/ TON ADNL, BOC deserialization is implemented.

Possible applications are entirely client-side off-chain components for a distributed TON project; API explorers; and much more!
GitHub GitHub - danog/madelineTon.js: Pure JS client-side implementation of the Telegram TON blockchain protocol Pure JS client-side implementation of the Telegram TON blockchain protocol - danog/madelineTon.js
Post #481 3.62K
The PWRTelegram app has been updated!

Features:
-
skip (private) messages download (add :f after token)

Fixes:
-
chat gallery
- scroll photos
- channels randomly disappear
- private chats with more than 100 messages do not load

Release Notes:
-
now is based on telegram 5.10
- some internal functions have been
rewrited to be more efficient with bots


source code: https://bit.ly/2lwO0um
apk: https://bit.ly/2kulsBB
Post #478 778

Forwarded from MadelineProto | Official Channel (Daniil Gentili)

Internal API improvements:
- I created a unique, reliable, fast and extremely simple update handling system based on MadelineProto's loop API, not present in any other MTProto client, not even tdlib.
- Brand new async Stream connection stack
- Unique async message handler stack
- Abstract TLCallback API
- File reference database
- DNS over HTTPS


With MadelineProto 4.0, each update is handled in parallel using a separate thread, and everything is done in parallel (even on restricted webhosts, perfect for creating file downloader bots!).

To learn more about parallel processing with async, see the following tutorials:
- Async basics
- Async HTTP (file_get_contents)
- Async helper functions (p. 1, 2)
- Async forking
- Async background loops
- Async libraries by AMPHP


I am really happy with how MadelineProto 4.0 turned out.

I had an absolute blast working on this update, and implementing async really opened a whole sea of possible innovations and features I can implement in MadelineProto now.

(this is just a TL;DR of the full changelog, see the original posts for the full feature list)
Telegram MadelineProto | Official Channel Possibly the most exciting thing to work on in this version of MadelineProto was the new update management system: I whipped it up in merely two days a few weeks ago, and it has absolutely improved the overall reliability of MadelineProto. Huge thanks to…
Older posts →
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →