pwrtelegram | Personal Development

Telegram-канал pwrtelegram - PWRTelegram API channel

885

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

Subscribe to a channel

PWRTelegram API 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 Aliaksei Levin, the developer of tdlib, for explaining to me how exactly does the MTProto update API work: he saved me a lot of time, and was really nice <3<3<3.

While thinking of an easy way I could implement the new update system, I had an inspiration:

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.

Instead of messing around with various synchronization locks, checks and cluttered update receivers, I implemented three simple feed loops.
Updates are fed to the first update loop, where some simple duplicate/hole checks are done.
Updates are then fed to a second update loop, where secondary duplicate/hole checks are done.
A third loop type takes care of eventual holes and periodically fetches updates for all supergroups, channels.

All of this is implemented without any kind of additional synchronization or locking due to the nature of the MadelineProto loop APIs, with 1% of the complexity of the official clients (which means less bugs and more pony time for me).

Читать полностью…

PWRTelegram API channel

Naturally, async is not the only feature present in MadelineProto 4.0: to implement async in MadelineProto, I rewrote the entire codebase two times over the course of the last six months, as shown in the diff:

~$ git diff --stat old master
187 files changed, 28692 insertions(+), 12288 deletions(-)


- I completely refactored the connection stack:
I threw out of the window my custom OOP wrapper for vanilla PHP sockets and created a brand new OOP connection stack.
The new connection stack uses a brand new incremental buffered async socket wrapper Stream API, that greatly simplifies work with layered protocols like MTProto.

Each MTProto packet is passed through a Stream layer, each one taking care of one part of the MTProto envelope, finally sending off everything to telegram using a simple AMPHP socket.

The simplified async buffered implementation of AMPHP sockets I created allowed me to easily add support for ALL MTProto protocols, including a few I haven't implemented before like the padded protocol.

Obfuscation is now handled via a separate setting, and can be enabled for all transports, not just tcp_abridged (it can be used to prevent ISP blocks in combination with the padded protocol, for example).

I also added support for different MTProto transports, including the brand new websocket transport and secure websocket transport (HTTPS), until now only implemented in tdlib!

If you want all communcations with telegram to be triple-encrypted using HTTPS+MTProto+obfuscation, you can enable the wss transport (the third layer of encryption w/ obfuscation will be enabled automatically).

Note: the websocket HTTPS MTProto transport is different from the HTTPS MTProto protocol (both are supported by MadelineProto).
The websocket HTTPS MTProto transport is more reliable and faster than the HTTPS MTProto protocol, since MadelineProto does not have to handle HTTP long polls.

(the websocket transport may or may not also be used in future to implement MadelineProto in the browser with webassembly ;)

The new proxy API is also based on the new stream API, and now supports MTProxies!
You can still use the socks5 and HTTP transports if you want.
Writing your custom proxies now is now a LOT easier, thanks to the neat structure of the stream APIs and the abundant PHPDOC comments.

Читать полностью…

PWRTelegram API channel

Fully asynchronous MadelineProto!

MadelineProto now features async, for incredible speed improvements, and parallel processing.
Powered by amphp, MadelineProto wraps the AMPHP APIs to provide a simpler generator-based async API.

What exactly is async, you may ask, and how is it better than threading or multiprocessing?
Async is a relatively new programming pattern that allows you to easily write non-blocking code as if you were using standard blocking functions.


More simply put: with MadelineProto 4.0, each update is handled in parallel using a separate thread, and everything is MUCH faster (even on restricted webhosts; this is perfect for creating file downloader bots!).

To enable async, you have to do two simple things:
1) Load the latest version of MadelineProto
2) yield your method calls.


That's it!
No need to set up thread pools, use synchronization primitives, and so on...
Just yield $MadelineProto->messages->sendMessage instead of $MadelineProto->messages->sendMessage.

Читать полностью…

PWRTelegram API channel

Hi people!

I've pushed new image version of PWRT on Docker Hub, the v0.2.

What is changed? Not much...

I added (as a requesto from Daniil few days ago) a directive (composer update) in the Caddyfile..

I've also re-pushed the first image and tagged it with pwrt:0.1, so it can still downloadable..

Hav a noice day!

PWRT DOCKER: https://hub.docker.com/r/houna/pwrt

PS: From now, latest tag, will be the same ID as the latest tag number (es 0.2, 0.3 etc) pushed..
Actualli latest tag is same as v0.2

Читать полностью…

PWRTelegram API channel

Also, do join the official group @pwrtelegramgroup!

Читать полностью…

PWRTelegram API channel

Also, here's an example call bot like @magnaluna, written in lua: http://gitlab.com/giuseppem99/lua-call-bot

Читать полностью…

PWRTelegram API channel

You can now install pwrtelegram via docker, thanks to houna!

https://hub.docker.com/r/houna/pwrt/

Читать полностью…

PWRTelegram API channel

Call @magnaluna for fun stuff ;)

Читать полностью…

PWRTelegram API channel

Full method list: docs.madelineproto.xyz/API_docs/methods

Читать полностью…

PWRTelegram API channel

MadelineProto is now approved by telegram: telegram.org/apps
کتابخانه میدلاین (MadelineProto ) توسط تلگرام تایید شد و در سایت رسمی تلگرام قرار گرفت: telegram.org/apps
What is MadelineProto?
میدلاین چیست؟
It's a library (a much better version of tg-cli) that allows you to create bots, userbots, and webradios like @magnaluna
میدلاین یک لایبرری (کتابخانه ای بهتر از tg-cli) است که به شما اجازه میدهد که ربات بسازید، ربات هایی با اکانتهای معمولی تلگرام بسازید و یا حتی رادیو راه اندازی کنید! نمونه ربات: @magnaluna (با این اکانت تماس بگیرید و رادیو گوش دهید!)

It can login as a normal user, or as a bot, and it can:
این کتابخانه به شما اجازه میدهد که بصورت یک اکانت معمولی یا ربات تلگرام لاگین کنید و امکانات زیر را در اختیار شما قرار میدهد:
- handle secret chats
- مدیریت چت های امنیتی (Secret Chat)
- play audio files in voice calls
- پخش فایل صوتی دلخواه در تماس های ورودی.
- press inline/normal keyboard buttons
- ایجاد کیبورد با دکمه های اینلاین و معمولی
- upload/download files up to 1.5 gb
- آپلود و دانلود فایل تا حجم 1.5گیگ
- join groups
- ورود به گروه ها
- set/change the 2FA password
- مدیریت پسورد ورود دو مرحله ای اکانت
- make bot payments
- ساخت ربات با قابلیت پرداخت های تحت تلگرام
- change the background of chats
- تغییر پس زمینه چت
- report users
- گزارش تخلف کاربران، کانل و ربات ها (report)
- send messages to every user in the chat list
- ارسال پیام به کاربر دلخواه
- set bios/propics/names
- مدیرت بیوگرافی، عکس پروفایل و مشخصات اکانت خود
- create/delete groups/channels/supergroups
- ساخت و مدیرت گروه، سوپرگروه و کانال
- create telegram accounts
- ساخت اکانت تلگرام (ثبت نام شماره جدید)
- add users to groups
- افزودن و دعوت کاربران به گروه و کانال
- obtain instant view versions of web pages
- قابلیت پیش نمایش صفحات وب
- add/block contacts
- افزودن، مدیریت و یا بلاک کردن مخاطب
- download telegram translations directly from their servers
- دانلود مستقیم ترجمه های تلگرام از سرورهای تلگرام
- search users messages
- جستجوی پیام کاربران، مخاطبان
- obtain the full member list of groups/channels
- بدست آوردن لیست کامل کابران گروه و یا کانال
- set granular limitations for users in groups (disallow sending stickers or gif or media or games or links or using inline bots) and channels/supergroups (can send or modify or delete or pin messages, ban or invite users or admins or create invite links)
- مدیریت اعضای گروه، مانند ایجاد محدودیت در ارسال پیام، استیکر و... و یا پین کردن یک پیام در گروه، تغییر لینک دعوت گروه و همچنین مدیرت اعضای کانال های خود.
- do everything official bots can do
- و هر امکانی که ربات های رسمی میتوانند انجام دهند با میدلاین هم میتوانید انجام دهید.
- do everything official apps can do
- همچنین هر امکانی که نرم افزار تلگرام رسمی دارد، میدلاین نیز دارد.

It can be used in every modern programming language, including PHP, Lua, Python, Javascript, Java, Rust, C++, C#, VBS (xd), and is now approved by Telegram, as you can see by the official app list: telegram.org/apps

این کتابخانه قابل استفاده در اکثر زبان ها مانند PHP, Lua, Python, Javascript, Java, Rust, C++, C#, VBS (xd) است و هم اکنون توسط سایت رسمی تلگرام مورد تایید قرارگرفته است.

The documentation can be found @ docs.madelineproto.xyz and pwrtelegram.xyz

راهنمای کامل این کتابخانه را از لینک های زیر مطالعه کنید:
docs.madelineproto.xyz
pwrtelegram.xyz

Thanks to wecan for the translation

Читать полностью…

PWRTelegram API channel

Madeline.py status:
(- = todo, + = done)

+ crypto module
+ TL module
+ message id handler module
- seqno handle module
- connection module
- message handler module
- auth key module
- peer handler module
- file handler module
- secret chat module
- call module


I've decided to make madeline.py free and open source.
But I will finish writing madeline.py only after receiving 50 donations bigger than 1$ to PayPal.me/danog
The reason for this is that I don't want to spend time on a software that no one will use and/or will be leaked as soon as I release it.

Читать полностью…

PWRTelegram API channel

Just helping out a fellow dev: http://telegra.ph/The-future-of-mattata-08-21

Читать полностью…

PWRTelegram API channel

PWRTelegram can do all of this, too!

Читать полностью…

PWRTelegram API channel

Also, I reorganized the docs!
Take a look at them @ docs.MadelineProto.xyz

Читать полностью…

PWRTelegram API channel

@magnaluna was deleted by telegram, you might want to recontact the new user with the same username.

Читать полностью…

PWRTelegram API channel

Streams and proxies aren't the only things that have been completely rewritten in this release:

I have written a unique socket message handler API based on MadelineProto's loop API, and guarantees maximum reliability while communicating with telegram.

By the way, the new async background loop API can also be used by you! It is perfect for repeating tasks in a cron-like manner, running multiple resumable event loops and much more! More on that later.

The new message handler loops run in the background, and guarantee that every single method call you make gets delivered to telegram.
Two signal loops running in two separate green threads take care of writing and reading data from the socket asynchronously.
A third signal loop uses state request messages to make sure that the method calls were received by telegram, and queries replies/resend method calls if something's wrong.
A fourth signal loop takes care of HTTP long polling.

This guarantees maximum stability even if telegram's having server issues.
The write loop also greatly reduces overhead, increasing performances by automatically wrapping in containers multiple method calls: this is especially useful when making multiple method calls simultaneously with async (more on that later).

The update state is now stored using a custom UpdatesState API, that will simplify backup to a DBMS backend later on :).

Читать полностью…

PWRTelegram API channel

And now, on to the API changes:
- First of all, we've got several bucketloads of telegram API changes, that can be viewed in the first posts.
- Very important, I wrote documentation on what to do if your account gets banned.
- Dropped support for PHP 5 and PHP 7.0: these versions of PHP have officially reached their end of life, so MadelineProto will not support them anymore.
You should use MadelineProto with PHP 7.3 (or PHP 7.2; PHP 7.1 is supported but not recommended).
- Dropped support for get_updates: it won't work properly on async, and I really recommend you stop using it
- You can now use the @support username in sendMessage and other methods to send messages to the support user!
- Now MadelineProto will automatically try to get the access hash of users not present in the internal peer database (this should reduce errors)!
- If any file cannot be downloaded to due issues with the tg media server that is hosting it, it will be automatically sent to the @support user (settings).
- Documented the MyTelegramOrgWrapper API, that can be used to login programmaticaly to the my.telegram.org management page and get the API ID of your app.
- Added an update_2fa method to update the login password
- Added a get_full_dialogs method to get a full list of all chats you’re member of, including dialog info (such as the pinned/last message ID, unread count, tag count, notification settings and message drafts).
- Added support for automatic file uploads by name in secret chats (as with normal chats); you can also now send secret chat messages using the sendMessage method as if it were a normal chat
- Added a resetUpdateState method to reset the update state and fetch ALL updates from the beginning
- Improved chat message splitting algorithm, for when the message you're trying to send is too long: performance improvements, and it will now notify you via the logs if there are too many entities in the logs, or if the entities are too long.
- Improved the get_self method.
- Added a __magic_sleep substitute for __sleep in the CombinedEventHandler
- Removed all dependencies to curl: now all HTTP requests are made asynchronously using a custom version of artax (more on that later).
- Updated php-libtgvoip and introduced a common API for changing phone call settings
- Improved the madeline.php loader
- Removed the old serialization APIs: now serialization is done automatically by MadelineProto!
- Increased the default flood wait limit to 10 minutes, since with async waiting for the flood wait isn't blocking anymore
- When running from web, MadelineProto will also automatically enable logging of PHP errors (not MadelineProto logs) to a MadelineProto.log file located in the same directory as the script that loaded MadelineProto.

Читать полностью…

PWRTelegram API channel

❤️⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣

Читать полностью…

PWRTelegram API channel

#pwrprojects @uploaditbot
This bot allows you to upload files of up to 1.5GB to telegram from a link, using MadelineProto.
created by @YoilyL

Читать полностью…

PWRTelegram API channel

Just for the noobs, the docker image https://hub.docker.com/r/houna/pwrt/ can be used to easily install pwrtelegram on your server, for free.

Читать полностью…

PWRTelegram API channel

Thanks to The Doctor, you can now use your tg-cli lua scripts with madeline!

http://github.com/giuseppem99/madeline_lua_shim

Читать полностью…

PWRTelegram API channel

Just a note, @stickeroptimizerbot, @audiokeychainbot, @bluetextbot, @mkcounterbot are still turned on, no idea how did @stickeroptimizerbot's token end up in the bot turned off broadcasting list.

Читать полностью…

PWRTelegram API channel

And now, let's talk about the future of my projects: PWRTelegram is now superseeded by MadelineProto, please use that now.
madeline.py is coming soon, the first beta (only for those who donated) probably this month, the final release probably towards december.

Since this year is my final high school year, development of all of my projects will slow down, and probably stop towards summer.
So you shouldn't don't worry if I'm offline for more than a few days ❤️

However, I also have some other really cool non-programming projects coming up.
I'll be holding a Swing course at my family's dance school towards October, make sure to like the school's facebook page (https://www.facebook.com/fantasiadanzarovigo/) to get all of the latest updates, I'll post here a link to the Swing event when it'll be ready.

Читать полностью…

PWRTelegram API channel

Please stop using PWRTelegram.

You may have noticed that PWRTelegram is having frequent and long periods of downtime lately.
That is due to the extremely heavy load it is under currently, so please stop using it.

PWRTelegram is just an HTTP wrapper for a free and open source telegram client library called MadelineProto (https://madelineproto.xyz).
You should all use directly MadelineProto, because it is SO much faster than PWRTelegram.

It can be used from PHP and Lua (a tg-cli wrapper is also available @ https://github.com/giuseppeM99/madeline_lua_shim), and you can easily write your own HTTP wrapper using PWRTelegram (github.com/pwrtelegram/pwrtelegram) as base.

It will be available in python in December, but PLEASE use the PHP version in the meantime, it is much faster than the python version, and much easier to use.

See docs.madelineproto.xyz for the method list and full instructions (you can also make telegram voice calls with MadelineProto!),

Читать полностью…

PWRTelegram API channel

MadelineProto is now approved by telegram: telegram.org/apps

What is MadelineProto?

It's a library (a much better version of tg-cli) that allows you to create bots, userbots, and webradios like @magnaluna

It can login as a normal user, or as a bot, and it can:
- handle secret chats
- play audio files in voice calls
- press inline/normal keyboard buttons
- upload/download files up to 1.5 gb
- join groups
- set/change the 2FA password
- make bot payments
- change the background of chats
- report users
- send messages to every user in the chat list
- set bios/propics/names
- create/delete groups/channels/supergroups
- create telegram accounts
- add users to groups
- obtain instant view versions of web pages
- add/block contacts
- download telegram translations directly from their servers
- search users messages
- obtain the full member list of groups/channels
- set granular limitations for users in groups (disallow sending stickers or gif or media or games or links or using inline bots) and channels/supergroups (can send or modify or delete or pin messages, ban or invite users or admins or create invite links)
- do everything official bots can do
- do everything official apps can do

It can be used in every modern programming language, including PHP, Lua, Python, Javascript, Java, Rust, C++, C#, VBS (xd), and is now approved by Telegram, as you can see by the official app list: telegram.org/apps

The documentation can be found @ docs.madelineproto.xyz and pwrtelegram.xyz

Читать полностью…

PWRTelegram API channel

Update php-libtgvoip to add getSignalBarsCount.
You can now run $controller->getSignalBarsCount() to get an integer representing a signal bar (0-4).

Читать полностью…

PWRTelegram API channel

How? Read docs.MadelineProto.xyz, docs.MadelineProto.xyz/API_docs (lua/php), pwrtelegram.xyz, http://docs.MadelineProto.xyz/API_docs (python/bash/c#/c++/any other language).

Читать полностью…

PWRTelegram API channel

Did you know that MadelineProto can handle secret chats, obtain the full member list of groups/channels, set granular limitations for users in groups (disallow sending stickers or gif or media or games or links or using inline bots) and channels (can send or modify or delete or pin messages, ban or invite users or admins or create invite links), login as a user, play audio files in voice calls, upload/download files up to 1.5 gb, join groups, set/change the 2FA password, make bot payments, change the background of chats, report users, send messages to every user in the chat list, set bios (even long ones), create/delete groups/channels/supergroups, create telegram accounts, press inline/normal keyboard buttons, add users, add users to groups, obtain instant view versions of web pages, add/block contacts, change your propic/name, download telegram translations directly from their servers, search users messages, and generally do everything bots and official apps do, from lua/php/python/bash/c#/c++/rust scripts?

Читать полностью…

PWRTelegram API channel

Fixed bugs with messages.editInlineBotMessage, messages.getInlineGameHighScores and messages.setInlineGameScore

Читать полностью…

PWRTelegram API channel

Please update MadelineProto, several fixes to error reporting were made.

Читать полностью…
Subscribe to a channel