MadelineProto | Persian Channel
332 subscribers
3 photos
1 file
44 links
کانال تلگرامی MadelineProto Farsi !
مرجع آموزش و آپدیت های مدلین به زبان فارسی!

👥 Persian Group: https://t.me/joinchat/DtxwN0RlsQoKyN-lpSuOEw

👥 English Group: https://t.me/joinchat/Bgrajz6K-aJS2Dc5HJ7dsA

📢 English Channel:
@MadelineProto
Download Telegram
آموزش استفاده از نسخه جدید میدلاین (قابلیت استفاده از MySQL بجای رم) روی هاست

سلام دوستان
همونطور که شاید بدونین میدلاین هنوز این نسخه رو بصورت phar منتشر نکرده و فقط روی سرور و با استفاده از composer میشه از این ورژن استفاده کرد
ولی من یه نسخه غیر رسمی از این ورژن رو برای هاست ها آماده کردم که میتونین موقتا تا آپدیت جدید میدلاین برای هاست ها از این نسخه استفاده کنین

برای نصب نسخه غیر رسمی میدلاین باید توی سورستون بجای تکه کد:
if (!file_exists('madeline.php')) {
copy('http://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

شما باید تکه کد پایین رو جایگزین کنین:
if (!file_exists('MadelineProto.php')) {
copy('https://MadelineProto.realsamy.ir/', 'MadelineProto.php');
}
include 'MadelineProto.php';

این تکه کد بجای نسخه رسمی قدیمی میدلاین، نسخه غیررسمی جدید (با قابلیت استفاده از MySQL بجای رم) رو نصب میکنه
البته بخاطر phar نبودن این نسخه و مدت زمانی که برای extract کردن فایل لازمه، نصب این فایل ممکنه یکم بیشتر از نسخه های قبلی طول بکشه (چون حجم فایل حدود 100 مگابایته)

ضمنا برای فعال کردن استفاده از MySQL باید از تنظیمات پایین توی سورستون استفاده کنین:
$settings = [
'db' => [
'type' => 'mysql',
'mysql' => [
'host' => '127.0.0.1',
'port' => '3306',
'user' => 'USERNAME',
'password' => 'PASSWORD',
'database' => 'DATABASE',
]
],
];

استفاده از این نسخه یه سری توضیحات لازم داره
اول اینکه این نسخه فقط برای ورژن پی اچ پی 7.4 به بالا هست و روی نسخه های پایینتر پی اچ پی جواب نمیده.
دوم اینکه برای اتصال به دیتابیس هاست پیشفرض همونطور که میبینید 127.0.0.1 هست که برای خودم روی هاست سیپنل جواب نداد و آیپی هاستینگ که توی صفحه اصلی سیپنل با اسم Shared IP Address مشخص شده جواب داد، ترجیحا اول آیپی پیشفرض رو تست کنین و اگه جواب نگرفتین آیپی هاستینگ رو استفاده کنین!

خیلی مخلصیم❤️
Sorry about all of this drama guys, didn't mean to hurt anyone.
MadelineProto is a free and open source project, and people can do what they want with it, I can't control you.

You can earn money on your sources, you can obfuscate your sources.

Personally, I do not approve of spamming and flooding with MadelineProto, and I would very much appreciate if a percentage of your earnings was contributed to me, as the developer of the original library.
However, if you decide to obfuscate sell your source, I'm 100% fine with it.

Previously some deobfuscated sources were posted on the official @madeline_farsi channel without the permission of the original creators, and in violation of internal MadelineProto admin rules.

I'm sorry about this, won't happen again.

The only thing I want is an open and international MadelineProto community with lots of sources and resources for MadelineProto users.
I don't have much time to work on MadelineProto myself these days, but I always appreciate people taking their time to help out the MadelineProto community.

Thank you all for the support ❤️
سلام به تمام اعضای کانال بزرگ میدلاین
چند روز پیش بنا به درخواست شما و بی احتیاطی بنده سورسی از یکی از دوستان بصورت دیکد شده در کانال قرار گرفت و باعث رنجش و آزرده خاطر شدن بعضی از دوستان شد
هدف ما فقط نشان دادن قدرت کتابخانه میدلاین بود که باعث نقض قوانین کپی رایت شد
بابت این اتفاق ازتون معذرت می‌خوام
#صفا

Hello to all members of the big madeline channel
A few days ago, at your request and with the carelessness of my servant, a source from a friend was decoded on the channel and caused annoyance and annoyance to some friends.
Our only goal was to show the power of the madeline Library, which violated copyright laws
I apologize for this
#Safa
MadelineProto | Persian Channel
Sorry about all of this drama guys, didn't mean to hurt anyone. MadelineProto is a free and open source project, and people can do what they want with it, I can't control you. You can earn money on your sources, you can obfuscate your sources. Personally…
با عرض پوزش در مورد همه این اتفاقات، هدف ما صدمه زدن به کسی نیست.
میدلاین یک پروژه آزاد و منبع باز است و مردم می توانند آنچه را که می خواهند با آن انجام دهند ، من نمی توانم شما را کنترل کنم.

می توانید از منابع خود درآمد کسب کنید ، می توانید منابع خود را دچار مشکل کنید.

به شخصه ، من ارسال پیام مکرر با میدلاین را تأیید نمی کنم ، و اگر درصدی از درآمد شما به عنوان توسعه دهنده کتابخانه اصلی به من کمک می کرد ، ممنون میشدم.
با این حال ، اگر تصمیم دارید که سورس انکد شده خود را به فروش برسانید ، من 100٪ با آن موافق هستم.

پیش از این برخی از سورس های دیکد شده بدون مجوز از سازندگان اصلی در کانال رسمی madeline_farsi ارسال شده بودند و شامل نقض قوانین داخلی میدلاین بودند.

با عرض پوزش در مورد این اتفاق ، تکرار نمیشود.

تنها چیزی که من می خواهم یک جامعه باز و بین المللی میدلاین است که دارای سورس و منابع زیادی برای کاربران میدلاین است.
من این روزها وقت زیادی برای کار کردن در کتابخانه میدلاین ندارم ، اما من همیشه از افرادی که وقت خود را صرف کمک به جامعه میدلاین می کنند قدردانی می کنم.

با تشکر از همه شما برای حمایت❤️
One more thing: I can't just replace my entire admin team just because someone tells me to.

As I said too many times, I don't know the language, and I just need to trust people, trust that they won't betray me.
The only thing I can do is just ask everyone to behave their very best, and apologize, if they did wrong.

MadelineProto is an MTProto library; the MadelineProto community is diverse and (very) iranian; MadelineProto is not about drama and rudeness.

This is a call to action both for users and admins: please, be nice to each other, recognize your mistakes and accept apologies.

MadelineProto is not about drama, MadeineProto is an MTProto library.
Let's keep it that way.
در حالی که همه ما منتظر MadelineProto 6 هستیم ، در اینجا چند منبع پلاگین کاملاً شسته و رفته کاملاً همگام برای MadelineProto وجود دارد:


realGuys/MadelineProtoPluginSystem -
یک مثال و بیس ساده جهت استفاده از افزونه ساده و در عین حال قدرتمند میدلاین پروتو به صورت پلاگین.

MohsenJS/MadelineProtoPluginSystem -
یک سیستم پلاگین MadelineProto با پشتیبانی از الگوهای و گفتگوها


در صورتی که شما چیز دیگری را بر پایه ی میدلاین پروتو توسعه داده اید، می توانید من را در گروه ها صدا بزنید، من آن را در این کانال منتشر خواهم کرد.
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
MadelineProto was updated!

MadelineProto 6 introduces ultra-fast startup with a built-in IPC server, PHP transpilation using phabel.io, MySQL/Postgres/redis database support to reduce RAM usage, and new, IDE-friendly settings.

The main event:
- MadelineProto is now transpiled using phabel.io!

Phabel.io is a PHP transpiler that allows native usage of PHP 8+ features in projects and libraries, while allowing maintainers to publish a version targeting lower versions of php.
Async await syntax is also supported!

Usage:
composer require --dev phabel/phabel

You can now publish your packagist package, and it will be automatically transpiled to any PHP version supported by phabel.

After git tagging a new release, just run:

vendor/bin/phabel publish

💡 Your PHP 7 users can now install your PHP 8 library 💡
💡 All your dependencies will also be transpiled to the correct PHP version. 💡

Supported PHP versions:

Syntax/feature support:
- 8.0+
- async/await syntax

Target:
- 7.1+
- 🐘 5.6, 7.0 in final testing stage.
- 💡 5.4, 5.5 support coming soon!

- Now MadelineProto has a built-in IPC server, this means:

Very fast startup for small scripts: ~0.02 seconds, before was 1-5 seconds

To use this IPC server, just use MadelineProto normally:

$API = new \danog\MadelineProto\API('session.madeline');
$API->start();
$API->messages->sendMessage(['peer' => $_POST['peer'], 'message' => $_POST['message']]);

This is useful for small sendMessage.php scripts, to be called from outside; for maximum performance in bots use an async event handler.

- New IDE-friendly settings API!
- Async MySQL/Postgres/redis integration:

Use a database to reduce memory usage to 1-5 MB even for thousands of groups!
See here for examples and documentation.
Native database integration in the event handler is also now supported!

Other brand-new features in MadelineProto 6:
- New PHP API documentation
- Updated Telegram API to layer 131
- Updated tg-file-decoder library
- New localization keys for all UI elements
- New settings for custom HTML, Javascript and CSS in login page templates
- New PSR logger API
- New session conversion API

Coming up soon: **** **IP implementation ;)

Internal improvements:
- Many, many bugfixes, stability fixes and performance improvements
- RPC requests are containerized by default, when possible
- Complete refactoring of MTProto message subsystem
- Added a periodic garbage collector
- Implemented native PHP prime factorization (C++ factorization is still recommended using prime.madelineproto.xyz)
MadelineProto | Persian Channel pinned «MadelineProto was updated! MadelineProto 6 introduces ultra-fast startup with a built-in IPC server, PHP transpilation using phabel.io, MySQL/Postgres/redis database support to reduce RAM usage, and new, IDE-friendly settings. The main event: - MadelineProto…»
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!
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
As usual, bot.php on github always contains a constantly-updated example source for the latest version of MadelineProto :)
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
Note: it seems like some versions of the eio extension may cause a corruption of the phar file, make sure to disable it to avoid issues.
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
Re-added php 7.1+ support for composer releases; madeline.php always supported php 7.1+.

As usual, legacy PHP versions are supported but php 8.1 is recommended for huge performance improvements with JIT and now amphp fibers :D

Also note that madeline.php phar builds will not behave properly with opcache, so use composer builds to make use of opcache and JIT on PHP 8+.
Forwarded from MadelineProto | Official Channel (Daniil Gentili)
Fixed Permission Denied errors on Windows caused by flock platform quirks.
This fixes madeline.php and downloads to files as well.
Forwarded from Daniil Gentili's news channel (Daniil Gentili)
Happy New Year everyone!

As a small present for any Blender user subscribed to this channel, I just created an AUR package for BlendNet: an open source plugin that allows distributing CPU and GPU renders across multiple machines.

BlendNet natively integrates with major cloud providers like AWS, Azure or GCP, and also supports self-hosting your own render farm.
My blendnet AUR package provides systemd units and configuration to quickly deploy your own self-hosted CUDA GPU-accelerated Blendnet render farm.

Feel free to check out the new arch BlendNet wiki page for more info: https://wiki.archlinux.org/title/Blender#BlendNet

Have fun Blendering in the new year!
MadelineProto was updated (8.0.0-beta80)!

Features:
- Introducing a new broadcasting API!
- You can now specify a custom serializer type for your ORM properties (one of the variants of the SerializerType enum, or null to choose the best serializer automatically (the default)).

Fixes:
- The documentation was updated, including human-readable descriptions for the latest layer.
- Postgres now uses the new BYTEA amphp APIs
- Multiple fixes and improvements.
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');

// The UI will ask you to insert your bot token here
$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'
]],
]);

Here's a simplified example, just for bots:

<?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');

$MadelineProto->botLogin('1234:token');

$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,
message_ids: [1, 2, 3, 4],
drop_author: false,
);

// Send messages WITHOUT showing the "Forwarded from" header
$id = $MadelineProto->broadcastForwardMessages(
from_peer: 101374607,
message_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.
MadelineProto was updated (8.0.0-beta87)!

MadelineProto now offers an official docker image for the linux/amd64, linux/arm64 and linux/riscv64 platforms!

The image comes with all dependencies pre-configured.
Both opcache and JIT are enabled by default, for maximum performance!

To get started, install docker:

curl -fsSL https://get.docker.com | sudo sh


Then increase the max_map_count sysctl configuration to avoid "Fiber stack allocate failed" and "Fiber stack protect failed" errors, since the PHP engine mmaps two memory regions per fiber.

echo 262144 | sudo tee /proc/sys/vm/max_map_count
echo vm.max_map_count=262144 | sudo tee /etc/sysctl.d/40-madelineproto.conf


Then, create the following docker-compose.yml file:

services:
bot:
image: hub.madelineproto.xyz/danog/madelineproto
restart: unless-stopped
tty: true
volumes:
- .:/app
command: php /app/bot.php


Then, create a bot.php file with your code, and run this command to log into the bot:

docker run --rm -it --init -v $PWD:/app hub.madelineproto.xyz/danog/madelineproto php /app/bot.php


After logging in, press ctrl-c to close the temporary container.

Finally, simply run this command to start the bot in the background.

docker compose up --pull always -d


Use docker compose logs to view MadelineProto logs and docker compose ps to view the status of your bot!

See the documentation for more info about the docker image.

Other features:
- Add getType method
- Add support for emojis with <emoji id="1234">👍</emoji>, <tg-emoji emoji-id="1234>👍</tg-emoji> HTML tags and tg://emoji?id=1234 HTML/markdown links, in addition to the pre-existing emoji:id HTML/markdown links.
- Add showPrompt AppInfo setting, to allow throwing an exception instead of showing a readline/UI prompt if no API ID was configured.

Fixes:
- Change name of parameter of broadcastForwardMessages from ids to message_ids to avoid confusion.
MadelineProto | Persian Channel pinned «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…»
#beta100 #update
خوب بریم درباره اپدیت بزرگ بتا 100 مدلین

اول از همه قابلیت های ریز رو میگم چون اونا خودش پیام جدا میخاد:

- پارامتر pin به broadcastMessages, broadcastForwardMessages اضافه شده و خودکار پیام رو میفرسته پین هم میکنه.

- متود sendMessageToAdmins اضافه شده که به همه ادمین هایی که توسط getReportPeers تعیین شدن پیام ارسال میکنه

- اضافه شدن متودهای wrapUpdate, wrapMessage, wrapMedia برای کار کردن با bound methods

- کلاس PeerNotInDbException برای هند ارور "This peer is not present in the internal peer database" اضافه شده

- متود isForum بررسی میکنه که آیا این سوپرگروه تاپیک داره یا نه.

- متود entitiesToHtml انتیتی هارو بصورت تگ html روی متن اعمال میکنه

- اگه مشکل رم دارید از متود reportMemoryProfile استفاده کنید تا فایل pprof به ادمین ها (getReportPeers) ارسال کنه و به دنیل با اطلاعات برای رفع مشکلات رم کمک کنید.

- برای ساختار کیبورد bot API کیبورد های جدید : pay, loginurl, webapp و لینک
tg://user?id=
هم اکنون پشتیبانی میشه.

- متود getAdminIds اضافه شده که لیست ایدی هایی رو میده که توسط getReportPeers شما مشخص کردید.

- با وجود enum ParseMode از این ببعد برای پارامتر mark_down باید ازش استفاده کنیم:
\danog\MadelineProto\ParseMode::HTM
\danog\MadelineProto\ParseMode::MARKDOWN
\danog\MadelineProto\ParseMode::TEXT

- برای پارس مود HTML lists هم پشتیبانی میشه.

- پارس مود مارک داون تگ های html رو دیگه تبدیل(پارس) نمیکنه.

- پارس مود ورژن 2 اپدیت هایی داشته : bot API MarkdownV2

باگ های رفع شده :

- مشکل دوباره اپلود کردن فایل ها حل شد.

- با استفاده از ReadableBuffer میتونیم از این ببعد یک رشته (باینری مدیا) رو توسط متودها در تلگرام اپلود کنیم.

- مشکلات رم تا حدودی بهینه شدند.

- اگه اروری تو onStart اتفاق بیافته باعث نمیشه اپدیت ها هندل نشن.
#handle_update #simple_filter
هندل آپدیت ها در نسخه 100 بتا

با توجه به php8 و قابلیت جدید Attribute مدلین قابلیت جدیدی برای هندل اپدیت ها ارائه کرده.
* هندل اپدیت بصورت قدیمی هنوز ممکنه ولی این روش کار رو بسیار آسون کرده.

برای هندل آپدیت ها ابتدا یک متود با Attribute Handler مینویسیم :

use danog\MadelineProto\EventHandler\Attributes\Handler;

#[Handler]
public function h1(Incoming & Message $message): void
{
// Handle all incoming messages (private+groups+channels).
}

هر متودی که اتربیوت Handler رو داشته باشه اپدیت ها به اون ارسال میشن.
برای فیلتر آپدیت ها دوتا راه دارید:
1- استفاده از Attribute Filter
2- استفاده از Simple Filter
- Simple Filter :
شما میتونید آبجکت هارو با هم ترکیب کنید
A|B , A&B
(A&B)|(C&D) ->
(فقط در php 8.2^)

مثال ها:
( پیام های ورودی: پیام هایی که دیگران میفرستند.
پیام های خروجی: پیام هایی که ربات میفرستد. )
Message
‎پیام های ورودی و خروجی

ChannelMessage
‎پیام های ورودی و خروجی کانال

GroupMessage
‎پیام های ورودی و خروجی گروه

PrivateMessage
‎پیام های ورودی و خروجی پیوی

ServiceMessage
‎پیام های ورودی و خروجی سرویس مسیج

AbstractMessage
‎پیام های ورودی و خروجی سرویس مسیج و پیام های عادی

Incoming & Message
‎پیام های ورودی

Incoming & GroupMessage & HasMedia
‎پیام های ورودی دارای رسانه گروه

موارد بیشتر رو میتونید از داکیومنت بررسی کنید.