2017-08-20 17:37:29 +02:00
# MadelineProto, a PHP MTProto telegram client
2015-03-11 16:42:20 +01:00
2019-04-29 13:03:54 +02:00
Created by < a href = "https://daniil.it" target = "_blank" rel = "noopener" > Daniil Gentili< / a >
2017-08-28 11:38:44 +02:00
2019-04-29 13:03:54 +02:00
Do join the official channel, [@MadelineProto ](https://t.me/MadelineProto ) and the [support groups ](https://t.me/pwrtelegramgroup )!
2017-08-20 18:04:54 +02:00
2019-05-31 17:59:50 +02:00
< a href = "https://telegram.org/apps" target = "_blank" rel = "noopener" > Approved by Telegram!< / a >
2018-03-12 22:10:49 +01:00
## What's this?
2017-08-20 18:04:54 +02:00
2018-03-14 12:08:10 +01:00
This library can be used to easily interact with Telegram **without** the bot API, just like the official apps.
It can login with a phone number (MTProto API), or with a bot token (MTProto API, **no bot API involved!** ).
2016-08-14 21:38:32 +02:00
2019-05-04 14:08:48 +02:00
[It is now fully async ](https://docs.madelineproto.xyz/docs/ASYNC.html )!
2019-06-05 16:45:33 +02:00
## Getting started ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html))
2017-03-11 19:54:51 +01:00
2018-03-20 13:04:44 +01:00
```php
2018-03-12 22:10:49 +01:00
< ?php
2017-02-05 15:15:48 +01:00
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
2018-03-12 22:10:49 +01:00
include 'madeline.php';
2017-12-21 10:52:23 +01:00
2018-03-23 18:23:28 +01:00
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
2019-06-05 16:45:33 +02:00
$MadelineProto->async(true);
$MadelineProto->loop(function () use ($MadelineProto) {
yield $MadelineProto->start();
2017-02-05 15:15:48 +01:00
2019-06-05 16:45:33 +02:00
$me = yield $MadelineProto->get_self();
2018-03-20 15:47:34 +01:00
2019-06-05 16:45:33 +02:00
$MadelineProto->logger($me);
2018-03-21 12:24:38 +01:00
2019-06-05 16:45:33 +02:00
if (!$me['bot']) {
yield $MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => "Hi!\nThanks for creating MadelineProto! < 3 "]);
yield $MadelineProto->channels->joinChannel(['channel' => '@MadelineProto']);
2018-03-20 15:47:34 +01:00
2019-06-05 16:45:33 +02:00
try {
yield $MadelineProto->messages->importChatInvite(['hash' => 'https://t.me/joinchat/Bgrajz6K-aJKu0IpGsLpBg']);
} catch (\danog\MadelineProto\RPCErrorException $e) {
$MadelineProto->logger($e);
}
2018-03-21 12:24:38 +01:00
2019-06-05 16:45:33 +02:00
yield $MadelineProto->messages->sendMessage(['peer' => 'https://t.me/joinchat/Bgrajz6K-aJKu0IpGsLpBg', 'message' => 'Testing MadelineProto!']);
}
yield $MadelineProto->echo('OK, done!');
});
2017-10-04 14:43:51 +02:00
```
2018-03-21 10:53:02 +01:00
[Try this code now! ](https://try.madelineproto.xyz ) or run this code in a browser or in a console.
2018-03-20 13:26:33 +01:00
2018-03-20 17:20:19 +01:00
Tip: if you receive an error (or nothing), [send us ](https://t.me/pwrtelegramgroup ) the error message and the `MadelineProto.log` file that was created in the same directory (if running from a browser).
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
2018-03-12 22:10:49 +01:00
## Documentation
2017-10-04 14:43:51 +02:00
2019-05-03 21:10:56 +02:00
* [Async ](https://docs.madelineproto.xyz/docs/ASYNC.html )
* [Usage ](https://docs.madelineproto.xyz/docs/ASYNC.html#usage )
2019-05-04 14:08:48 +02:00
* [Enabling the MadelineProto async API ](https://docs.madelineproto.xyz/docs/ASYNC.html#enabling-the-madelineproto-async-api )
* [Using the MadelineProto async API ](https://docs.madelineproto.xyz/docs/ASYNC.html#using-the-madelineproto-async-api )
* [Async in event handler ](https://docs.madelineproto.xyz/docs/ASYNC.html#async-in-event-handler )
* [Async in callback handler ](https://docs.madelineproto.xyz/docs/ASYNC.html#async-in-callback-handler )
* [Wrapped async ](https://docs.madelineproto.xyz/docs/ASYNC.html#wrapped-async )
2019-06-06 00:33:11 +02:00
* [Multiple async ](https://docs.madelineproto.xyz/docs/ASYNC.html#multiple-async )
2019-06-07 17:21:43 +02:00
* [ArrayAccess async ](https://docs.madelineproto.xyz/docs/ASYNC.html#arrayaccess-async )
2019-05-04 14:08:48 +02:00
* [Ignored async ](https://docs.madelineproto.xyz/docs/ASYNC.html#ignored-async )
* [Blocking async ](https://docs.madelineproto.xyz/docs/ASYNC.html#blocking-async )
2019-05-03 21:10:56 +02:00
* [MadelineProto and AMPHP async APIs ](https://docs.madelineproto.xyz/docs/ASYNC.html#madelineproto-and-amphp-async-apis )
2019-06-02 13:50:04 +02:00
* [Helper methods ](https://docs.madelineproto.xyz/docs/ASYNC.html#helper-methods )
* [Async sleep ](https://docs.madelineproto.xyz/docs/ASYNC.html#async-sleep-does-not-block-the-main-thread )
2019-06-05 15:38:32 +02:00
* [Async readline ](https://docs.madelineproto.xyz/docs/ASYNC.html#async-readline-does-not-block-the-main-thread )
2019-06-06 00:33:11 +02:00
* [Async echo ](https://docs.madelineproto.xyz/docs/ASYNC.html#async-echo-does-not-block-the-main-thread )
2019-06-02 13:50:04 +02:00
* [MadelineProto artax HTTP client ](https://docs.madelineproto.xyz/docs/ASYNC.html#madelineproto-artax-http-client )
2019-06-06 00:33:11 +02:00
* [Async forking ](https://docs.madelineproto.xyz/docs/ASYNC.html#async-forking-does-green-thread-forking )
2019-06-24 15:46:38 +02:00
* [Async flock ](https://docs.madelineproto.xyz/docs/ASYNC.html#async-flock )
2019-06-02 13:50:04 +02:00
* [Combining async operations ](https://docs.madelineproto.xyz/docs/ASYNC.html#combining-async-operations )
* [MadelineProto async loop APIs ](https://docs.madelineproto.xyz/docs/ASYNC.html#async-loop-apis )
* [Loop ](https://docs.madelineproto.xyz/docs/ASYNC.html#loop )
* [ResumableLoop ](https://docs.madelineproto.xyz/docs/ASYNC.html#resumableloop )
* [SignalLoop ](https://docs.madelineproto.xyz/docs/ASYNC.html#signalloop )
* [ResumableSignalLoop ](https://docs.madelineproto.xyz/docs/ASYNC.html#resumablesignalloop )
* [GenericLoop ](https://docs.madelineproto.xyz/docs/ASYNC.html#genericloop )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Creating a client ](https://docs.madelineproto.xyz/docs/CREATING_A_CLIENT.html )
2019-06-21 17:02:52 +02:00
* [Login ](https://docs.madelineproto.xyz/docs/LOGIN.html )
2019-06-05 15:38:32 +02:00
* [Getting permission to use the telegram API ](https://docs.madelineproto.xyz/docs/LOGIN.html#getting-permission-to-use-the-telegram-api )
2019-06-05 12:04:36 +02:00
* [Automatic ](https://docs.madelineproto.xyz/docs/LOGIN.html#automatic-now-fully-async )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Manual (user) ](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-user )
2019-06-05 15:38:32 +02:00
* [API ID ](https://docs.madelineproto.xyz/docs/LOGIN.html#api-id )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Manual (bot) ](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-bot )
* [Logout ](https://docs.madelineproto.xyz/docs/LOGIN.html#logout )
2019-06-05 12:04:36 +02:00
* [Changing 2FA password ](https://docs.madelineproto.xyz/docs/LOGIN.html#changing-2fa-password )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Features ](https://docs.madelineproto.xyz/docs/FEATURES.html )
* [Requirements ](https://docs.madelineproto.xyz/docs/REQUIREMENTS.html )
* [Installation ](https://docs.madelineproto.xyz/docs/INSTALLATION.html )
* [Simple ](https://docs.madelineproto.xyz/docs/INSTALLATION.html#simple )
* [Simple (manual) ](https://docs.madelineproto.xyz/docs/INSTALLATION.html#simple-manual )
* [Composer from scratch ](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-scratch )
* [Composer from existing project ](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-existing-project )
2019-06-05 12:04:36 +02:00
* [Handling updates (new messages) ](https://docs.madelineproto.xyz/docs/UPDATES.html )
2019-06-06 15:57:21 +02:00
* [Self-restart on webhosts ](https://docs.madelineproto.xyz/docs/UPDATES.html#self-restart-on-webhosts )
2019-06-02 13:50:04 +02:00
* [Async Event driven ](https://docs.madelineproto.xyz/docs/UPDATES.html#async-event-driven )
* [Multi-account: Async Combined Event driven update handling ](https://docs.madelineproto.xyz/docs/UPDATES.html#async-combined-event-driven )
* [Async Callback ](https://docs.madelineproto.xyz/docs/UPDATES.html#async-callback )
* [Noop (default) ](https://docs.madelineproto.xyz/docs/UPDATES.html#noop )
2019-06-05 12:04:36 +02:00
* [Fetch all updates from the beginning ](https://docs.madelineproto.xyz/docs/UPDATES.html#fetch-all-updates-from-the-beginning )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Settings ](https://docs.madelineproto.xyz/docs/SETTINGS.html )
* [Getting info about the current user ](https://docs.madelineproto.xyz/docs/SELF.html )
* [Exceptions ](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html )
* [List of exception types ](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html#list-of-exception-types )
* [Pretty TL trace ](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html#pretty-tl-trace )
* [Getting the TL trace ](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html#getting-the-tl-trace )
2018-03-20 15:47:34 +01:00
* [Avoiding FLOOD_WAITs ](https://docs.madelineproto.xyz/docs/FLOOD_WAIT.html )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Logging ](https://docs.madelineproto.xyz/docs/LOGGING.html )
2019-03-08 14:34:53 +01:00
* [Telegram VoIP phone calls ](https://docs.madelineproto.xyz/docs/CALLS.html )
* [Requesting a call ](https://docs.madelineproto.xyz/docs/CALLS.html#requesting-a-call )
* [Playing mp3 files ](https://docs.madelineproto.xyz/docs/CALLS.html#playing-mp3-files )
* [Playing streams ](https://docs.madelineproto.xyz/docs/CALLS.html#playing-streams )
* [Changing audio quality ](https://docs.madelineproto.xyz/docs/CALLS.html#changing-audio-quality )
* [Putting it all together ](https://docs.madelineproto.xyz/docs/CALLS.html#putting-it-all-together )
* [Accepting calls ](https://docs.madelineproto.xyz/docs/CALLS.html#accepting-calls )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Uploading and downloading files ](https://docs.madelineproto.xyz/docs/FILES.html )
* [Uploading & sending files ](https://docs.madelineproto.xyz/docs/FILES.html#sending-files )
* [Security notice ](https://docs.madelineproto.xyz/docs/FILES.html#security-notice )
* [Photos ](https://docs.madelineproto.xyz/docs/FILES.html#inputmediauploadedphoto )
* [Documents ](https://docs.madelineproto.xyz/docs/FILES.html#inputmediauploadeddocument )
* [Documents ](https://docs.madelineproto.xyz/docs/FILES.html#documentattributefilename-to-send-a-document )
* [Photos as documents ](https://docs.madelineproto.xyz/docs/FILES.html#documentattributeimagesize-to-send-a-photo-as-document )
* [GIFs ](https://docs.madelineproto.xyz/docs/FILES.html#documentattributeanimated-to-send-a-gif )
* [Videos ](https://docs.madelineproto.xyz/docs/FILES.html#documentattributevideo-to-send-a-video )
* [Audio & Voice ](https://docs.madelineproto.xyz/docs/FILES.html#documentattributeaudio-to-send-an-audio-file )
* [Uploading files ](https://docs.madelineproto.xyz/docs/FILES.html#uploading-files )
* [Bot API file IDs ](https://docs.madelineproto.xyz/docs/FILES.html#bot-api-file-ids )
* [Reusing uploaded files ](https://docs.madelineproto.xyz/docs/FILES.html#reusing-uploaded-files )
* [Downloading files ](https://docs.madelineproto.xyz/docs/FILES.html#downloading-files )
* [Extracting download info ](https://docs.madelineproto.xyz/docs/FILES.html#extracting-download-info )
2019-06-23 13:08:44 +02:00
* [Downloading profile pictures ](https://docs.madelineproto.xyz/docs/FILES.html#downloading-profile-pictures )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Download to directory ](https://docs.madelineproto.xyz/docs/FILES.html#download-to-directory )
* [Download to file ](https://docs.madelineproto.xyz/docs/FILES.html#download-to-file )
* [Download to browser (streaming) ](https://docs.madelineproto.xyz/docs/FILES.html#download-to-browser-with-streams )
* [Getting progress ](https://docs.madelineproto.xyz/docs/FILES.html#getting-progress )
* [Getting info about chats ](https://docs.madelineproto.xyz/docs/CHAT_INFO.html )
2019-06-05 12:04:36 +02:00
* [Full chat info with full list of participants ](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_pwr_chat-now-fully-async )
* [Full chat info ](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_full_info-now-fully-async )
* [Reduced chat info (very fast) ](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_info-now-fully-async )
2019-06-30 15:12:43 +02:00
* [Just the chat ID (extremely fast) ](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_id-now-fully-async )
2018-03-20 20:43:11 +01:00
* [Getting all chats (dialogs) ](https://docs.madelineproto.xyz/docs/DIALOGS.html )
2019-06-05 12:04:36 +02:00
* [Dialog list ](https://docs.madelineproto.xyz/docs/DIALOGS.html#get_dialogs-now-fully-async )
* [Full dialog info ](https://docs.madelineproto.xyz/docs/DIALOGS.html#get_full_dialogs-now-fully-async )
2019-06-02 13:50:04 +02:00
* [Inline buttons ([now fully async! ](https://docs.madelineproto.xyz/docs/ASYNC.html ))](https://docs.madelineproto.xyz/docs/INLINE_BUTTONS.html)
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Secret chats ](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html )
2019-06-05 12:04:36 +02:00
* [Requesting secret chats ](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#requesting-secret-chats-now-fully-async )
* [Accepting secret chats ](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#accepting-secret-chats-now-fully-async )
* [Checking secret chat status ](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#checking-secret-chat-status-now-fully-async )
* [Sending secret messages ](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#sending-secret-messages-now-fully-async )
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
* [Lua binding ](https://docs.madelineproto.xyz/docs/LUA.html )
* [Using a proxy ](https://docs.madelineproto.xyz/docs/PROXY.html )
2019-06-02 13:50:04 +02:00
* [How to set a proxy ](https://docs.madelineproto.xyz/docs/PROXY.html#how-to-set-a-proxy )
* [Multiple proxies with automatic switch ](https://docs.madelineproto.xyz/docs/PROXY.html#multiple-proxies-with-automatic-switch )
* [Use pre-built MTProxy ](https://docs.madelineproto.xyz/docs/PROXY.html#mtproxy )
2018-04-18 16:40:40 +02:00
* [Use pre-built Socks5 proxy ](https://docs.madelineproto.xyz/docs/PROXY.html#socks5-proxy )
* [Use pre-built HTTP proxy ](https://docs.madelineproto.xyz/docs/PROXY.html#http-proxy )
* [Build your own proxy ](https://docs.madelineproto.xyz/docs/PROXY.html#build-your-proxy )
2019-03-08 14:34:53 +01:00
* [Using methods ](https://docs.madelineproto.xyz/docs/USING_METHODS.html )
* [FULL API Documentation with descriptions ](https://docs.madelineproto.xyz/API_docs/methods/ )
2019-03-08 15:16:58 +01:00
* [Logout ](https://docs.madelineproto.xyz/logout.html )
* [Login ](https://docs.madelineproto.xyz/docs/LOGIN.html )
2019-06-05 12:04:36 +02:00
* [Change 2FA password ](https://docs.madelineproto.xyz/update_2fa.html )
2019-03-08 15:16:58 +01:00
* [Get all chats, broadcast a message to all chats ](https://docs.madelineproto.xyz/docs/DIALOGS.html )
* [Get the full participant list of a channel/group/supergroup ](https://docs.madelineproto.xyz/get_pwr_chat.html )
* [Get full info about a user/chat/supergroup/channel ](https://docs.madelineproto.xyz/get_full_info.html )
* [Get info about a user/chat/supergroup/channel ](https://docs.madelineproto.xyz/get_info.html )
* [Get info about the currently logged-in user ](https://docs.madelineproto.xyz/get_self.html )
* [Upload or download files up to 1.5 GB ](https://docs.madelineproto.xyz/docs/FILES.html )
* [Make a phone call and play a song ](https://docs.madelineproto.xyz/docs/CALLS.html )
* [Create a secret chat bot ](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html )
2019-03-08 14:34:53 +01:00
* [Peers ](https://docs.madelineproto.xyz/docs/USING_METHODS.html#peers )
* [Files ](https://docs.madelineproto.xyz/docs/FILES.html )
* [Secret chats ](https://docs.madelineproto.xyz/docs/USING_METHODS.html#secret-chats )
* [Entities (Markdown & HTML) ](https://docs.madelineproto.xyz/docs/USING_METHODS.html#entities )
* [reply_markup (keyboards & inline keyboards) ](https://docs.madelineproto.xyz/docs/USING_METHODS.html#reply_markup )
* [bot API objects ](https://docs.madelineproto.xyz/docs/USING_METHODS.html#bot-api-objects )
* [No result ](https://docs.madelineproto.xyz/docs/USING_METHODS.html#no-result )
* [Queues ](https://docs.madelineproto.xyz/docs/USING_METHODS.html#queues )
2019-06-06 00:33:11 +02:00
* [Multiple method calls ](https://docs.madelineproto.xyz/docs/USING_METHODS.html#multiple-method-calls )
2018-03-21 10:53:02 +01:00
* [Contributing ](https://docs.madelineproto.xyz/docs/CONTRIB.html )
* [Translation ](https://docs.madelineproto.xyz/docs/CONTRIB.html#translation )
* [Contribution guide ](https://docs.madelineproto.xyz/docs/CONTRIB.html#contribution-guide )
* [Credits ](https://docs.madelineproto.xyz/docs/CONTRIB.html#credits )
2018-03-20 22:18:19 +01:00
* [Web templates for `$MadelineProto->start()` ](https://docs.madelineproto.xyz/docs/TEMPLATES.html )
2017-10-04 14:43:51 +02:00
2018-03-12 22:10:49 +01:00
## Very complex and complete examples
2017-08-18 13:27:44 +02:00
You can find examples for nearly every MadelineProto function in
* [`tests/testing.php` ](https://github.com/danog/MadelineProto/blob/master/tests/testing.php ) - examples for making/receiving calls, making secret chats, sending secret chat messages, videos, audios, voice recordings, gifs, stickers, photos, sending normal messages, videos, audios, voice recordings, gifs, stickers, photos.
* [`bot.php` ](https://github.com/danog/MadelineProto/blob/master/bot.php ) - examples for sending normal messages, downloading any media
2018-03-12 22:10:49 +01:00
* [`secret_bot.php` ](https://github.com/danog/MadelineProto/blob/master/secret_bot.php ) - secret chat bot
2017-08-18 13:27:44 +02:00
* [`magna.php` ](https://github.com/danog/MadelineProto/blob/master/magna.php ) - examples for receiving calls
2017-09-26 15:08:25 +02:00
* [`userbots/pipesbot.php` ](https://github.com/danog/MadelineProto/blob/master/userbots/pipesbot.php ) - examples for creating inline bots and using other inline bots via a userbot
2018-03-12 22:10:49 +01:00
* [`userbots/MadelineProto_bot.php` ](https://github.com/danog/MadelineProto/blob/master/userbots/MadelineProto_bot.php ) - Multi-function bot
* [`userbots/pwrtelegram_debug_bot` ](https://github.com/danog/MadelineProto/blob/master/userbots/pwrtelegram_debug_bot.php ) - Multi-function bot
2016-10-07 00:36:18 +02:00
2015-03-11 17:52:28 +01:00