From 2bf609d0443b8cbb3b97216c9c4e9b33424471e5 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 21 Apr 2017 13:13:24 +0200 Subject: [PATCH] Updated to layer 66, added CDN file download logic, added option to send messages longer than 4096 chars, fixed documentation, fixed bugs --- .gitignore | 2 + README.md | 17 +- build_docs.php | 6 +- calls.php | 2 +- docs/API_docs/constructors/dcOption.md | 5 +- .../constructors/documentAttributeVideo.md | 5 +- docs/API_docs/constructors/index.md | 30 +++- docs/API_docs/constructors/user.md | 5 +- docs/API_docs/index.md | 6 +- docs/API_docs/methods/auth_sendInvites.md | 6 + .../methods/help_setBotUpdatesStatus.md | 6 + docs/API_docs/methods/index.md | 8 +- .../methods/messages_editInlineBotMessage.md | 6 + docs/API_docs/methods/messages_editMessage.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + docs/API_docs/methods/messages_saveDraft.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + docs/API_docs/methods/messages_sendMessage.md | 6 + .../methods/messages_setBotCallbackAnswer.md | 6 + docs/API_docs/types/ContactStatus.md | 2 + docs/API_docs/types/MessagesFilter.md | 4 + docs/API_docs/types/ReceivedNotifyMessage.md | 2 + docs/API_docs/types/SendMessageAction.md | 4 + docs/API_docs/types/StickerSetCovered.md | 4 + docs/API_docs/types/User.md | 12 ++ docs/API_docs/types/WallPaper.md | 2 + docs/API_docs/types/index.md | 24 ++- docs/API_docs/types/upload_File.md | 2 + docs/Chat.md | 1 + docs/index.md | 17 +- log | 89 ---------- .../API_docs_v18/methods/auth_sendInvites.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v18/types/ContactStatus.md | 2 + old_docs/API_docs_v18/types/README.md | 14 +- old_docs/API_docs_v18/types/User.md | 18 +++ old_docs/API_docs_v18/types/WallPaper.md | 2 + .../API_docs_v23/methods/auth_sendInvites.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v23/types/ContactStatus.md | 2 + old_docs/API_docs_v23/types/README.md | 14 +- old_docs/API_docs_v23/types/User.md | 22 +++ old_docs/API_docs_v23/types/WallPaper.md | 2 + .../API_docs_v25/methods/auth_sendInvites.md | 6 + .../methods/geochats_sendMessage.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v25/types/ContactStatus.md | 2 + old_docs/API_docs_v25/types/README.md | 14 +- old_docs/API_docs_v25/types/User.md | 22 +++ old_docs/API_docs_v25/types/WallPaper.md | 2 + .../API_docs_v27/methods/auth_sendInvites.md | 6 + .../methods/geochats_sendMessage.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v27/types/ContactStatus.md | 2 + old_docs/API_docs_v27/types/README.md | 14 +- old_docs/API_docs_v27/types/User.md | 22 +++ old_docs/API_docs_v27/types/WallPaper.md | 2 + .../API_docs_v33/methods/auth_sendInvites.md | 6 + .../methods/geochats_sendMessage.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v33/types/ContactStatus.md | 2 + old_docs/API_docs_v33/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v33/types/User.md | 14 ++ old_docs/API_docs_v33/types/WallPaper.md | 2 + .../API_docs_v38/methods/auth_sendInvites.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v38/types/ContactStatus.md | 2 + old_docs/API_docs_v38/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v38/types/User.md | 12 ++ old_docs/API_docs_v38/types/WallPaper.md | 2 + .../API_docs_v40/methods/auth_sendInvites.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v40/types/ContactStatus.md | 2 + old_docs/API_docs_v40/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v40/types/User.md | 14 ++ old_docs/API_docs_v40/types/WallPaper.md | 2 + .../API_docs_v41/methods/auth_sendInvites.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v41/types/ContactStatus.md | 2 + old_docs/API_docs_v41/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v41/types/User.md | 12 ++ old_docs/API_docs_v41/types/WallPaper.md | 2 + .../API_docs_v42/methods/auth_sendInvites.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v42/types/ContactStatus.md | 2 + old_docs/API_docs_v42/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v42/types/User.md | 12 ++ old_docs/API_docs_v42/types/WallPaper.md | 2 + .../API_docs_v44/methods/auth_sendInvites.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v44/types/ContactStatus.md | 2 + old_docs/API_docs_v44/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v44/types/User.md | 12 ++ old_docs/API_docs_v44/types/WallPaper.md | 2 + .../API_docs_v45/methods/auth_sendInvites.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v45/types/ContactStatus.md | 2 + old_docs/API_docs_v45/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v45/types/User.md | 12 ++ old_docs/API_docs_v45/types/WallPaper.md | 2 + .../API_docs_v46/methods/auth_sendInvites.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + old_docs/API_docs_v46/types/ContactStatus.md | 2 + old_docs/API_docs_v46/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v46/types/User.md | 12 ++ old_docs/API_docs_v46/types/WallPaper.md | 2 + .../API_docs_v51/methods/auth_sendInvites.md | 6 + .../methods/messages_editInlineBotMessage.md | 6 + .../methods/messages_editMessage.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + .../methods/messages_setBotCallbackAnswer.md | 6 + old_docs/API_docs_v51/types/ContactStatus.md | 2 + old_docs/API_docs_v51/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v51/types/User.md | 12 ++ old_docs/API_docs_v51/types/WallPaper.md | 2 + .../API_docs_v53/methods/auth_sendInvites.md | 6 + .../methods/messages_editInlineBotMessage.md | 6 + .../methods/messages_editMessage.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_saveDraft.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + .../methods/messages_setBotCallbackAnswer.md | 6 + old_docs/API_docs_v53/types/ContactStatus.md | 2 + old_docs/API_docs_v53/types/README.md | 16 +- .../types/ReceivedNotifyMessage.md | 2 + old_docs/API_docs_v53/types/User.md | 12 ++ old_docs/API_docs_v53/types/WallPaper.md | 2 + .../API_docs_v55/methods/auth_sendInvites.md | 6 + .../methods/messages_editInlineBotMessage.md | 6 + .../methods/messages_editMessage.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_saveDraft.md | 6 + .../methods/messages_sendBroadcast.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + .../methods/messages_setBotCallbackAnswer.md | 6 + old_docs/API_docs_v55/types/ContactStatus.md | 2 + old_docs/API_docs_v55/types/README.md | 18 +-- .../types/ReceivedNotifyMessage.md | 2 + .../API_docs_v55/types/StickerSetCovered.md | 2 + old_docs/API_docs_v55/types/User.md | 12 ++ old_docs/API_docs_v55/types/WallPaper.md | 2 + .../API_docs_v57/methods/auth_sendInvites.md | 6 + .../methods/messages_editInlineBotMessage.md | 6 + .../methods/messages_editMessage.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_saveDraft.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + .../methods/messages_setBotCallbackAnswer.md | 6 + old_docs/API_docs_v57/types/ContactStatus.md | 2 + old_docs/API_docs_v57/types/README.md | 18 +-- .../types/ReceivedNotifyMessage.md | 2 + .../API_docs_v57/types/StickerSetCovered.md | 4 + old_docs/API_docs_v57/types/User.md | 12 ++ old_docs/API_docs_v57/types/WallPaper.md | 2 + .../API_docs_v62/methods/auth_sendInvites.md | 6 + .../methods/help_setBotUpdatesStatus.md | 6 + .../methods/messages_editInlineBotMessage.md | 6 + .../methods/messages_editMessage.md | 6 + .../methods/messages_getWebPagePreview.md | 6 + .../methods/messages_saveDraft.md | 6 + .../methods/messages_sendEncrypted.md | 6 + .../methods/messages_sendEncryptedFile.md | 6 + .../methods/messages_sendEncryptedService.md | 6 + .../methods/messages_sendMessage.md | 6 + .../methods/messages_setBotCallbackAnswer.md | 6 + old_docs/API_docs_v62/types/ContactStatus.md | 2 + old_docs/API_docs_v62/types/README.md | 18 +-- .../types/ReceivedNotifyMessage.md | 2 + .../API_docs_v62/types/StickerSetCovered.md | 4 + old_docs/API_docs_v62/types/User.md | 12 ++ old_docs/API_docs_v62/types/WallPaper.md | 2 + old_docs/README.md | 2 +- src/danog/MadelineProto/API.php | 74 +-------- src/danog/MadelineProto/DataCenter.php | 43 ++--- src/danog/MadelineProto/DocsBuilder.php | 38 +++-- src/danog/MadelineProto/InternalDoc.php | 26 +++ src/danog/MadelineProto/Logger.php | 6 +- src/danog/MadelineProto/MTProto.php | 152 +++++++++++++----- .../MTProtoTools/AuthKeyHandler.php | 28 +++- .../MTProtoTools/CallHandler.php | 37 ++++- .../MadelineProto/MTProtoTools/Crypt.php | 10 ++ .../MadelineProto/MTProtoTools/Files.php | 30 +++- .../MTProtoTools/MessageHandler.php | 3 + .../MTProtoTools/PeerHandler.php | 27 ++-- .../MTProtoTools/ResponseHandler.php | 11 +- .../MTProtoTools/UpdateHandler.php | 8 +- src/danog/MadelineProto/RSA.php | 18 ++- src/danog/MadelineProto/Serialization.php | 7 + src/danog/MadelineProto/Stream.php | 2 +- .../MadelineProto/TL/Conversion/BotAPI.php | 31 ++++ .../MadelineProto/TL/Conversion/Extension.php | 3 +- src/danog/MadelineProto/TL/TL.php | 15 +- src/danog/MadelineProto/TL/TLParams.php | 3 +- src/danog/MadelineProto/TL_telegram_v65.tl | 2 +- .../MadelineProto/Threads/SocketReader.php | 25 ++- src/danog/MadelineProto/Tools.php | 13 +- tests/testing.php | 92 ++++++----- 280 files changed, 1890 insertions(+), 571 deletions(-) delete mode 100644 log diff --git a/.gitignore b/.gitignore index a5e393b4..c7cdcf0c 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,5 @@ telegram-cli* src/danog/MadelineProto/Fuzzer.php fuzzer.php tests/500mb +*.save +*.save.1 diff --git a/README.md b/README.md index 438e9744..40e7e016 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ Also note that MadelineProto will perform better if python and a big math extens This project is in beta state. -The MadelineProto API documentation can be found [here (layer 65)](https://daniil.it/MadelineProto/API_docs/). VERY IMPORTANT READ THIS. +The MadelineProto API documentation can be found [here (layer 66)](https://daniil.it/MadelineProto/API_docs/). VERY IMPORTANT READ THIS. -The TD documentation can be found [here](https://daniil.it/MadelineProto/TD_docs/). +The TD documentation can be found [here](https://daniil.it/MadelineProto/TD_docs/). (you cannot use the methods described here in MadelineProto without the lua extension) The MadelineProto API documentation (mtproto tl scheme) can be found [here](https://daniil.it/MadelineProto/MTProto_docs/). @@ -80,14 +80,21 @@ Thanks to the devs that contributed to these projects, MadelineProto is now an e ### RTFM -If you have some questions about the usage of the methods of this library, you can join the [support group](https://telegram.me/pwrtelegramgroup) or contact [@danogentili](https://telegram.me/danogentili). +If you have some questions about the usage of the methods of this library, you can join the [support group](https://telegram.me/pwrtelegramgroup) or contact [@danogentili](https://telegram.me/danogentili). -But first, please read this WHOLE page very carefully, follow all links to external documentation, and read all examples in the repo. +But first, please read this WHOLE page very carefully, follow all links to external documentation, and read all examples in the repo (bot.php, bots/, tests/testing.php). If you don't understand something, read everything again. +You MUST know OOP programming in order to use this library. + I will NOT answer to questions that can be answered simply by reading this page; I will instead ask you to read it carefully twice. +A very important page you must read is the [API documentation](https://daniil.it/MadelineProto/API_docs/): if it's the first time you see a link to that page it means you didn't read the documentation carefully. + +I can offer support, however, when it comes to MadelineProto bugs or problems in the documentation. I will not write code for you for free, however you can hire me to do that if you want (my rate is 50$ per hour); you can also buy an easy to use, customized MadelineProto base for only 30$. + +If you're selling a MadelineProto base too, you really should consider donating at least 20% of the price of the base: [this is my PayPal](https://paypal.me/danog). ### Installation @@ -443,6 +450,8 @@ Methods that allow sending message entities (messages.sendMessage for example) a To convert the results of methods to bot API objects you must provide a second parameter to method wrappers, containing an array with the `botAPI` key set to true. +To disable fetching the result of a method, the array that must be provided as second parameter to method wrapper must have the `noResponse` key set to true. + reply_markup accepts bot API reply markup objects as well as MTProto ones. Note that when you login as a bot, MadelineProto also logins using the [PWRTelegram](https://pwrtelegram.xyz) API, to allow persistant storage of peers, even after a logout and another login. diff --git a/build_docs.php b/build_docs.php index 7078b89d..96d097da 100755 --- a/build_docs.php +++ b/build_docs.php @@ -38,9 +38,9 @@ $docs = [ 'readme' => false, ], [ - 'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v65.tl', 'calls' => __DIR__.'/src/danog/MadelineProto/TL_calls.tl', 'secret' => __DIR__.'/src/danog/MadelineProto/TL_secret.tl', 'td' => __DIR__.'/src/danog/MadelineProto/TL_td.tl'], - 'title' => 'MadelineProto API documentation (layer 65)', - 'description' => 'MadelineProto API documentation (layer 65)', + 'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v66.tl', 'calls' => __DIR__.'/src/danog/MadelineProto/TL_calls.tl', 'secret' => __DIR__.'/src/danog/MadelineProto/TL_secret.tl', 'td' => __DIR__.'/src/danog/MadelineProto/TL_td.tl'], + 'title' => 'MadelineProto API documentation (layer 66)', + 'description' => 'MadelineProto API documentation (layer 66)', 'output_dir' => __DIR__.'/docs/API_docs', 'readme' => false, ], diff --git a/calls.php b/calls.php index 5ee414a6..c66bc95c 100644 --- a/calls.php +++ b/calls.php @@ -55,7 +55,7 @@ if ($MadelineProto === false) { } if ($authorization['_'] === 'account.needSignup') { \danog\MadelineProto\Logger::log(['Registering new user'], \danog\MadelineProto\Logger::NOTICE); - $authorization = $MadelineProto->complete_signup($code, readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); + $authorization = $MadelineProto->complete_signup(readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); } echo 'Serializing MadelineProto to calls.madeline...'.PHP_EOL; echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('calls.madeline', $MadelineProto).' bytes'.PHP_EOL; diff --git a/docs/API_docs/constructors/dcOption.md b/docs/API_docs/constructors/dcOption.md index c05fcca1..e3fe29da 100644 --- a/docs/API_docs/constructors/dcOption.md +++ b/docs/API_docs/constructors/dcOption.md @@ -14,6 +14,7 @@ description: dcOption attributes, type and example |ipv6|[Bool](../types/Bool.md) | Optional| |media\_only|[Bool](../types/Bool.md) | Optional| |tcpo\_only|[Bool](../types/Bool.md) | Optional| +|cdn|[Bool](../types/Bool.md) | Optional| |id|[int](../types/int.md) | Yes| |ip\_address|[string](../types/string.md) | Yes| |port|[int](../types/int.md) | Yes| @@ -26,14 +27,14 @@ description: dcOption attributes, type and example ### Example: ``` -$dcOption = ['_' => 'dcOption', 'ipv6' => Bool, 'media_only' => Bool, 'tcpo_only' => Bool, 'id' => int, 'ip_address' => string, 'port' => int, ]; +$dcOption = ['_' => 'dcOption', 'ipv6' => Bool, 'media_only' => Bool, 'tcpo_only' => Bool, 'cdn' => Bool, 'id' => int, 'ip_address' => string, 'port' => int, ]; ``` Or, if you're into Lua: ``` -dcOption={_='dcOption', ipv6=Bool, media_only=Bool, tcpo_only=Bool, id=int, ip_address=string, port=int, } +dcOption={_='dcOption', ipv6=Bool, media_only=Bool, tcpo_only=Bool, cdn=Bool, id=int, ip_address=string, port=int, } ``` diff --git a/docs/API_docs/constructors/documentAttributeVideo.md b/docs/API_docs/constructors/documentAttributeVideo.md index b9f06676..4c23e731 100644 --- a/docs/API_docs/constructors/documentAttributeVideo.md +++ b/docs/API_docs/constructors/documentAttributeVideo.md @@ -11,6 +11,7 @@ description: documentAttributeVideo attributes, type and example | Name | Type | Required | |----------|:-------------:|---------:| +|round\_message|[Bool](../types/Bool.md) | Optional| |duration|[int](../types/int.md) | Yes| |w|[int](../types/int.md) | Yes| |h|[int](../types/int.md) | Yes| @@ -23,14 +24,14 @@ description: documentAttributeVideo attributes, type and example ### Example: ``` -$documentAttributeVideo = ['_' => 'documentAttributeVideo', 'duration' => int, 'w' => int, 'h' => int, ]; +$documentAttributeVideo = ['_' => 'documentAttributeVideo', 'round_message' => Bool, 'duration' => int, 'w' => int, 'h' => int, ]; ``` Or, if you're into Lua: ``` -documentAttributeVideo={_='documentAttributeVideo', duration=int, w=int, h=int, } +documentAttributeVideo={_='documentAttributeVideo', round_message=Bool, duration=int, w=int, h=int, } ``` diff --git a/docs/API_docs/constructors/index.md b/docs/API_docs/constructors/index.md index 55496238..52eaa0a5 100644 --- a/docs/API_docs/constructors/index.md +++ b/docs/API_docs/constructors/index.md @@ -91,6 +91,12 @@ description: List of constructors ***

[$botInlineResult](../constructors/botInlineResult.md) = \['id' => [string](../types/string.md), 'type' => [string](../types/string.md), 'title' => [string](../types/string.md), 'description' => [string](../types/string.md), 'url' => [string](../types/string.md), 'thumb_url' => [string](../types/string.md), 'content_url' => [string](../types/string.md), 'content_type' => [string](../types/string.md), 'w' => [int](../types/int.md), 'h' => [int](../types/int.md), 'duration' => [int](../types/int.md), 'send_message' => [BotInlineMessage](../types/BotInlineMessage.md), \]; +*** +

[$cdnConfig](../constructors/cdnConfig.md) = \['public_keys' => \[[CdnPublicKey](../types/CdnPublicKey.md)\], \]; + +*** +

[$cdnPublicKey](../constructors/cdnPublicKey.md) = \['dc_id' => [int](../types/int.md), 'public_key' => [string](../types/string.md), \]; + ***

[$channel](../constructors/channel.md) = \['creator' => [Bool](../types/Bool.md), 'kicked' => [Bool](../types/Bool.md), 'left' => [Bool](../types/Bool.md), 'editor' => [Bool](../types/Bool.md), 'moderator' => [Bool](../types/Bool.md), 'broadcast' => [Bool](../types/Bool.md), 'verified' => [Bool](../types/Bool.md), 'megagroup' => [Bool](../types/Bool.md), 'restricted' => [Bool](../types/Bool.md), 'democracy' => [Bool](../types/Bool.md), 'signatures' => [Bool](../types/Bool.md), 'min' => [Bool](../types/Bool.md), 'id' => [int](../types/int.md), 'access_hash' => [long](../types/long.md), 'title' => [string](../types/string.md), 'username' => [string](../types/string.md), 'photo' => [ChatPhoto](../types/ChatPhoto.md), 'date' => [int](../types/int.md), 'version' => [int](../types/int.md), 'restriction_reason' => [string](../types/string.md), \]; @@ -247,7 +253,7 @@ description: List of constructors

[$dataJSON](../constructors/dataJSON.md) = \['data' => [string](../types/string.md), \]; *** -

[$dcOption](../constructors/dcOption.md) = \['ipv6' => [Bool](../types/Bool.md), 'media_only' => [Bool](../types/Bool.md), 'tcpo_only' => [Bool](../types/Bool.md), 'id' => [int](../types/int.md), 'ip_address' => [string](../types/string.md), 'port' => [int](../types/int.md), \]; +

[$dcOption](../constructors/dcOption.md) = \['ipv6' => [Bool](../types/Bool.md), 'media_only' => [Bool](../types/Bool.md), 'tcpo_only' => [Bool](../types/Bool.md), 'cdn' => [Bool](../types/Bool.md), 'id' => [int](../types/int.md), 'ip_address' => [string](../types/string.md), 'port' => [int](../types/int.md), \]; ***

[$decryptedDataBlock](../constructors/decryptedDataBlock.md) = \['voice_call_id' => [int128](../types/int128.md), 'in_seq_no' => [int](../types/int.md), 'out_seq_no' => [int](../types/int.md), 'recent_received_mask' => [int](../types/int.md), 'proto' => [int](../types/int.md), 'extra' => [string](../types/string.md), 'raw_data' => [string](../types/string.md), \]; @@ -640,6 +646,12 @@ description: List of constructors ***

[$inputMessagesFilterPhotos](../constructors/inputMessagesFilterPhotos.md) = \[\]; +*** +

[$inputMessagesFilterRoundVideo](../constructors/inputMessagesFilterRoundVideo.md) = \[\]; + +*** +

[$inputMessagesFilterRoundVoice](../constructors/inputMessagesFilterRoundVoice.md) = \[\]; + ***

[$inputMessagesFilterUrl](../constructors/inputMessagesFilterUrl.md) = \[\]; @@ -1300,6 +1312,9 @@ description: List of constructors ***

[$sendMessageRecordAudioAction\_17](../constructors/sendMessageRecordAudioAction_17.md) = \[\]; +*** +

[$sendMessageRecordRoundAction](../constructors/sendMessageRecordRoundAction.md) = \[\]; + ***

[$sendMessageRecordVideoAction\_17](../constructors/sendMessageRecordVideoAction_17.md) = \[\]; @@ -1315,6 +1330,9 @@ description: List of constructors ***

[$sendMessageUploadPhotoAction\_17](../constructors/sendMessageUploadPhotoAction_17.md) = \[\]; +*** +

[$sendMessageUploadRoundAction](../constructors/sendMessageUploadRoundAction.md) = \[\]; + ***

[$sendMessageUploadVideoAction\_17](../constructors/sendMessageUploadVideoAction_17.md) = \[\]; @@ -1637,12 +1655,18 @@ description: List of constructors [$updates\_state](../constructors/updates_state.md) = \['pts' => [int](../types/int.md), 'qts' => [int](../types/int.md), 'date' => [int](../types/int.md), 'seq' => [int](../types/int.md), 'unread_count' => [int](../types/int.md), \]; *** -

[$upload\_file](../constructors/upload_file.md) = \['type' => [storage\_FileType](../types/storage_FileType.md), 'mtime' => [int](../types/int.md), 'bytes' => [bytes](../types/bytes.md), \]; +

[$upload\_cdnFile](../constructors/upload_cdnFile.md) = \['bytes' => [bytes](../types/bytes.md), \]; + +[$upload\_cdnFileReuploadNeeded](../constructors/upload_cdnFileReuploadNeeded.md) = \['request_token' => [bytes](../types/bytes.md), \]; + +[$upload\_file](../constructors/upload_file.md) = \['type' => [storage\_FileType](../types/storage_FileType.md), 'mtime' => [int](../types/int.md), 'bytes' => [bytes](../types/bytes.md), \]; + +[$upload\_fileCdnRedirect](../constructors/upload_fileCdnRedirect.md) = \['dc_id' => [int](../types/int.md), 'file_token' => [bytes](../types/bytes.md), 'encryption_key' => [bytes](../types/bytes.md), 'encryption_iv' => [bytes](../types/bytes.md), \]; [$upload\_webFile](../constructors/upload_webFile.md) = \['size' => [int](../types/int.md), 'mime_type' => [string](../types/string.md), 'file_type' => [storage\_FileType](../types/storage_FileType.md), 'mtime' => [int](../types/int.md), 'bytes' => [bytes](../types/bytes.md), \]; *** -

[$user](../constructors/user.md) = \['self' => [Bool](../types/Bool.md), 'contact' => [Bool](../types/Bool.md), 'mutual_contact' => [Bool](../types/Bool.md), 'deleted' => [Bool](../types/Bool.md), 'bot' => [Bool](../types/Bool.md), 'bot_chat_history' => [Bool](../types/Bool.md), 'bot_nochats' => [Bool](../types/Bool.md), 'verified' => [Bool](../types/Bool.md), 'restricted' => [Bool](../types/Bool.md), 'min' => [Bool](../types/Bool.md), 'bot_inline_geo' => [Bool](../types/Bool.md), 'id' => [int](../types/int.md), 'access_hash' => [long](../types/long.md), 'first_name' => [string](../types/string.md), 'last_name' => [string](../types/string.md), 'username' => [string](../types/string.md), 'phone' => [string](../types/string.md), 'photo' => [UserProfilePhoto](../types/UserProfilePhoto.md), 'status' => [UserStatus](../types/UserStatus.md), 'bot_info_version' => [int](../types/int.md), 'restriction_reason' => [string](../types/string.md), 'bot_inline_placeholder' => [string](../types/string.md), \]; +

[$user](../constructors/user.md) = \['self' => [Bool](../types/Bool.md), 'contact' => [Bool](../types/Bool.md), 'mutual_contact' => [Bool](../types/Bool.md), 'deleted' => [Bool](../types/Bool.md), 'bot' => [Bool](../types/Bool.md), 'bot_chat_history' => [Bool](../types/Bool.md), 'bot_nochats' => [Bool](../types/Bool.md), 'verified' => [Bool](../types/Bool.md), 'restricted' => [Bool](../types/Bool.md), 'min' => [Bool](../types/Bool.md), 'bot_inline_geo' => [Bool](../types/Bool.md), 'id' => [int](../types/int.md), 'access_hash' => [long](../types/long.md), 'first_name' => [string](../types/string.md), 'last_name' => [string](../types/string.md), 'username' => [string](../types/string.md), 'phone' => [string](../types/string.md), 'photo' => [UserProfilePhoto](../types/UserProfilePhoto.md), 'status' => [UserStatus](../types/UserStatus.md), 'bot_info_version' => [int](../types/int.md), 'restriction_reason' => [string](../types/string.md), 'bot_inline_placeholder' => [string](../types/string.md), 'lang_code' => [string](../types/string.md), \]; ***

[$userEmpty](../constructors/userEmpty.md) = \['id' => [int](../types/int.md), \]; diff --git a/docs/API_docs/constructors/user.md b/docs/API_docs/constructors/user.md index 900236af..259a8531 100644 --- a/docs/API_docs/constructors/user.md +++ b/docs/API_docs/constructors/user.md @@ -33,6 +33,7 @@ description: user attributes, type and example |bot\_info\_version|[int](../types/int.md) | Optional| |restriction\_reason|[string](../types/string.md) | Optional| |bot\_inline\_placeholder|[string](../types/string.md) | Optional| +|lang\_code|[string](../types/string.md) | Optional| @@ -42,14 +43,14 @@ description: user attributes, type and example ### Example: ``` -$user = ['_' => 'user', 'self' => Bool, 'contact' => Bool, 'mutual_contact' => Bool, 'deleted' => Bool, 'bot' => Bool, 'bot_chat_history' => Bool, 'bot_nochats' => Bool, 'verified' => Bool, 'restricted' => Bool, 'min' => Bool, 'bot_inline_geo' => Bool, 'id' => int, 'access_hash' => long, 'first_name' => string, 'last_name' => string, 'username' => string, 'phone' => string, 'photo' => UserProfilePhoto, 'status' => UserStatus, 'bot_info_version' => int, 'restriction_reason' => string, 'bot_inline_placeholder' => string, ]; +$user = ['_' => 'user', 'self' => Bool, 'contact' => Bool, 'mutual_contact' => Bool, 'deleted' => Bool, 'bot' => Bool, 'bot_chat_history' => Bool, 'bot_nochats' => Bool, 'verified' => Bool, 'restricted' => Bool, 'min' => Bool, 'bot_inline_geo' => Bool, 'id' => int, 'access_hash' => long, 'first_name' => string, 'last_name' => string, 'username' => string, 'phone' => string, 'photo' => UserProfilePhoto, 'status' => UserStatus, 'bot_info_version' => int, 'restriction_reason' => string, 'bot_inline_placeholder' => string, 'lang_code' => string, ]; ``` Or, if you're into Lua: ``` -user={_='user', self=Bool, contact=Bool, mutual_contact=Bool, deleted=Bool, bot=Bool, bot_chat_history=Bool, bot_nochats=Bool, verified=Bool, restricted=Bool, min=Bool, bot_inline_geo=Bool, id=int, access_hash=long, first_name=string, last_name=string, username=string, phone=string, photo=UserProfilePhoto, status=UserStatus, bot_info_version=int, restriction_reason=string, bot_inline_placeholder=string, } +user={_='user', self=Bool, contact=Bool, mutual_contact=Bool, deleted=Bool, bot=Bool, bot_chat_history=Bool, bot_nochats=Bool, verified=Bool, restricted=Bool, min=Bool, bot_inline_geo=Bool, id=int, access_hash=long, first_name=string, last_name=string, username=string, phone=string, photo=UserProfilePhoto, status=UserStatus, bot_info_version=int, restriction_reason=string, bot_inline_placeholder=string, lang_code=string, } ``` diff --git a/docs/API_docs/index.md b/docs/API_docs/index.md index a46f0f00..1ebe9207 100644 --- a/docs/API_docs/index.md +++ b/docs/API_docs/index.md @@ -1,8 +1,8 @@ --- -title: MadelineProto API documentation (layer 65) -description: MadelineProto API documentation (layer 65) +title: MadelineProto API documentation (layer 66) +description: MadelineProto API documentation (layer 66) --- -# MadelineProto API documentation (layer 65) +# MadelineProto API documentation (layer 66) [Methods](methods/) diff --git a/docs/API_docs/methods/auth_sendInvites.md b/docs/API_docs/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/docs/API_docs/methods/auth_sendInvites.md +++ b/docs/API_docs/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/docs/API_docs/methods/help_setBotUpdatesStatus.md b/docs/API_docs/methods/help_setBotUpdatesStatus.md index 820d3c0f..f90469e2 100644 --- a/docs/API_docs/methods/help_setBotUpdatesStatus.md +++ b/docs/API_docs/methods/help_setBotUpdatesStatus.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = help.setBotUpdatesStatus({pending_updates_count=int, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/docs/API_docs/methods/index.md b/docs/API_docs/methods/index.md index b95cb489..8710731b 100644 --- a/docs/API_docs/methods/index.md +++ b/docs/API_docs/methods/index.md @@ -202,6 +202,8 @@ $MadelineProto->[destroy_session](destroy_session.md)(\['session_id' => [long](. $MadelineProto->[help->getAppUpdate](help_getAppUpdate.md)(\[\]) === [$help\_AppUpdate](../types/help_AppUpdate.md) +$MadelineProto->[help->getCdnConfig](help_getCdnConfig.md)(\[\]) === [$CdnConfig](../types/CdnConfig.md) + $MadelineProto->[help->getConfig](help_getConfig.md)(\[\]) === [$Config](../types/Config.md) $MadelineProto->[help->getInviteText](help_getInviteText.md)(\[\]) === [$help\_InviteText](../types/help_InviteText.md) @@ -465,10 +467,14 @@ $MadelineProto->[updates->getDifference](updates_getDifference.md)(\['pts' => [i $MadelineProto->[updates->getState](updates_getState.md)(\[\]) === [$updates\_State](../types/updates_State.md) *** -

$MadelineProto->[upload->getFile](upload_getFile.md)(\['location' => [InputFileLocation](../types/InputFileLocation.md), 'offset' => [int](../types/int.md), 'limit' => [int](../types/int.md), \]) === [$upload\_File](../types/upload_File.md) +

$MadelineProto->[upload->getCdnFile](upload_getCdnFile.md)(\['file_token' => [bytes](../types/bytes.md), 'offset' => [int](../types/int.md), 'limit' => [int](../types/int.md), \]) === [$upload\_CdnFile](../types/upload_CdnFile.md) + +$MadelineProto->[upload->getFile](upload_getFile.md)(\['location' => [InputFileLocation](../types/InputFileLocation.md), 'offset' => [int](../types/int.md), 'limit' => [int](../types/int.md), \]) === [$upload\_File](../types/upload_File.md) $MadelineProto->[upload->getWebFile](upload_getWebFile.md)(\['location' => [InputWebFileLocation](../types/InputWebFileLocation.md), 'offset' => [int](../types/int.md), 'limit' => [int](../types/int.md), \]) === [$upload\_WebFile](../types/upload_WebFile.md) +$MadelineProto->[upload->reuploadCdnFile](upload_reuploadCdnFile.md)(\['file_token' => [bytes](../types/bytes.md), 'request_token' => [bytes](../types/bytes.md), \]) === [$Bool](../types/Bool.md) + $MadelineProto->[upload->saveBigFilePart](upload_saveBigFilePart.md)(\['file_id' => [long](../types/long.md), 'file_part' => [int](../types/int.md), 'file_total_parts' => [int](../types/int.md), 'bytes' => [bytes](../types/bytes.md), \]) === [$Bool](../types/Bool.md) $MadelineProto->[upload->saveFilePart](upload_saveFilePart.md)(\['file_id' => [long](../types/long.md), 'file_part' => [int](../types/int.md), 'bytes' => [bytes](../types/bytes.md), \]) === [$Bool](../types/Bool.md) diff --git a/docs/API_docs/methods/messages_editInlineBotMessage.md b/docs/API_docs/methods/messages_editInlineBotMessage.md index ae98c13d..e6e74c03 100644 --- a/docs/API_docs/methods/messages_editInlineBotMessage.md +++ b/docs/API_docs/methods/messages_editInlineBotMessage.md @@ -54,6 +54,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/docs/API_docs/methods/messages_editMessage.md b/docs/API_docs/methods/messages_editMessage.md index 3ce73b6c..574344cc 100644 --- a/docs/API_docs/methods/messages_editMessage.md +++ b/docs/API_docs/methods/messages_editMessage.md @@ -55,6 +55,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/docs/API_docs/methods/messages_getWebPagePreview.md b/docs/API_docs/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/docs/API_docs/methods/messages_getWebPagePreview.md +++ b/docs/API_docs/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/docs/API_docs/methods/messages_saveDraft.md b/docs/API_docs/methods/messages_saveDraft.md index c3324146..1c624176 100644 --- a/docs/API_docs/methods/messages_saveDraft.md +++ b/docs/API_docs/methods/messages_saveDraft.md @@ -48,6 +48,12 @@ Bool = messages.saveDraft({no_webpage=Bool, reply_to_msg_id=int, peer=InputPeer, ``` +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/docs/API_docs/methods/messages_sendEncrypted.md b/docs/API_docs/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/docs/API_docs/methods/messages_sendEncrypted.md +++ b/docs/API_docs/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/docs/API_docs/methods/messages_sendEncryptedFile.md b/docs/API_docs/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/docs/API_docs/methods/messages_sendEncryptedFile.md +++ b/docs/API_docs/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/docs/API_docs/methods/messages_sendEncryptedService.md b/docs/API_docs/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/docs/API_docs/methods/messages_sendEncryptedService.md +++ b/docs/API_docs/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/docs/API_docs/methods/messages_sendMessage.md b/docs/API_docs/methods/messages_sendMessage.md index e7f23e30..99f51a31 100644 --- a/docs/API_docs/methods/messages_sendMessage.md +++ b/docs/API_docs/methods/messages_sendMessage.md @@ -58,6 +58,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/docs/API_docs/methods/messages_setBotCallbackAnswer.md b/docs/API_docs/methods/messages_setBotCallbackAnswer.md index 73a43bf2..1b0c8cd2 100644 --- a/docs/API_docs/methods/messages_setBotCallbackAnswer.md +++ b/docs/API_docs/methods/messages_setBotCallbackAnswer.md @@ -46,3 +46,9 @@ Or, if you're into Lua: Bool = messages.setBotCallbackAnswer({alert=Bool, query_id=long, message=string, url=string, cache_time=int, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/docs/API_docs/types/ContactStatus.md b/docs/API_docs/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/docs/API_docs/types/ContactStatus.md +++ b/docs/API_docs/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/docs/API_docs/types/MessagesFilter.md b/docs/API_docs/types/MessagesFilter.md index 42118a7b..f497be27 100644 --- a/docs/API_docs/types/MessagesFilter.md +++ b/docs/API_docs/types/MessagesFilter.md @@ -33,6 +33,10 @@ description: constructors and methods of type MessagesFilter [inputMessagesFilterPhoneCalls](../constructors/inputMessagesFilterPhoneCalls.md) +[inputMessagesFilterRoundVoice](../constructors/inputMessagesFilterRoundVoice.md) + +[inputMessagesFilterRoundVideo](../constructors/inputMessagesFilterRoundVideo.md) + ### Methods that return an object of this type (methods): diff --git a/docs/API_docs/types/ReceivedNotifyMessage.md b/docs/API_docs/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/docs/API_docs/types/ReceivedNotifyMessage.md +++ b/docs/API_docs/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/docs/API_docs/types/SendMessageAction.md b/docs/API_docs/types/SendMessageAction.md index b8fae772..86b0b3dd 100644 --- a/docs/API_docs/types/SendMessageAction.md +++ b/docs/API_docs/types/SendMessageAction.md @@ -33,6 +33,10 @@ Notifies about activity in chat [sendMessageGamePlayAction](../constructors/sendMessageGamePlayAction.md) +[sendMessageRecordRoundAction](../constructors/sendMessageRecordRoundAction.md) + +[sendMessageUploadRoundAction](../constructors/sendMessageUploadRoundAction.md) + [sendMessageTypingAction\_17](../constructors/sendMessageTypingAction_17.md) [sendMessageCancelAction\_17](../constructors/sendMessageCancelAction_17.md) diff --git a/docs/API_docs/types/StickerSetCovered.md b/docs/API_docs/types/StickerSetCovered.md index 5158b759..ef955281 100644 --- a/docs/API_docs/types/StickerSetCovered.md +++ b/docs/API_docs/types/StickerSetCovered.md @@ -9,6 +9,10 @@ description: constructors and methods of type StickerSetCovered ### Possible values (constructors): +[stickerSetCovered](../constructors/stickerSetCovered.md) + +[stickerSetMultiCovered](../constructors/stickerSetMultiCovered.md) + ### Methods that return an object of this type (methods): diff --git a/docs/API_docs/types/User.md b/docs/API_docs/types/User.md index 3301b5b4..664ac56e 100644 --- a/docs/API_docs/types/User.md +++ b/docs/API_docs/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + diff --git a/docs/API_docs/types/WallPaper.md b/docs/API_docs/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/docs/API_docs/types/WallPaper.md +++ b/docs/API_docs/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/docs/API_docs/types/index.md b/docs/API_docs/types/index.md index a25cd22a..59689273 100644 --- a/docs/API_docs/types/index.md +++ b/docs/API_docs/types/index.md @@ -22,6 +22,10 @@ description: List of types [BotInlineResult](BotInlineResult.md) +[CdnConfig](CdnConfig.md) + +[CdnPublicKey](CdnPublicKey.md) + [ChannelMessagesFilter](ChannelMessagesFilter.md) [ChannelParticipant](ChannelParticipant.md) @@ -306,20 +310,6 @@ description: List of types [UserStatus](UserStatus.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[StickerSetCovered](StickerSetCovered.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [WallPaper](WallPaper.md) [WebDocument](WebDocument.md) @@ -380,6 +370,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) @@ -448,6 +442,8 @@ description: List of types [updates\_State](updates_State.md) +[upload\_CdnFile](upload_CdnFile.md) + [upload\_File](upload_File.md) [upload\_WebFile](upload_WebFile.md) diff --git a/docs/API_docs/types/upload_File.md b/docs/API_docs/types/upload_File.md index 1c0aabdc..8ac3a279 100644 --- a/docs/API_docs/types/upload_File.md +++ b/docs/API_docs/types/upload_File.md @@ -11,6 +11,8 @@ description: constructors and methods of type upload_File [upload\_file](../constructors/upload_file.md) +[upload\_fileCdnRedirect](../constructors/upload_fileCdnRedirect.md) + ### Methods that return an object of this type (methods): diff --git a/docs/Chat.md b/docs/Chat.md index 02a26370..7b4688a1 100644 --- a/docs/Chat.md +++ b/docs/Chat.md @@ -15,6 +15,7 @@ description: chat attributes, type and example |access\_hash|[long](API_docs/types/long.md) | Yes|access hash of peer| |first\_name|[string](API_docs/types/string.md) | Yes|First name of the user| |last\_name|[string](API_docs/types/string.md) | Optional|Last name of the user| +|lang\_code|[string](API_docs/types/string.md) | Optional|Language of the user| |username|[string](API_docs/types/string.md) | Optional|Username| |verified|[Bool](API_docs/types/Bool.md) | Optional|Is the peer official?| |restricted|[Bool](API_docs/types/Bool.md) | Optional|Is the peer restricted to the current user?| diff --git a/docs/index.md b/docs/index.md index ccfaf6b7..cd1a45ab 100644 --- a/docs/index.md +++ b/docs/index.md @@ -20,9 +20,9 @@ Also note that MadelineProto will perform better if python and a big math extens This project is in beta state. -The MadelineProto API documentation can be found [here (layer 65)](https://daniil.it/MadelineProto/API_docs/). VERY IMPORTANT READ THIS. +The MadelineProto API documentation can be found [here (layer 66)](https://daniil.it/MadelineProto/API_docs/). VERY IMPORTANT READ THIS. -The TD documentation can be found [here](https://daniil.it/MadelineProto/TD_docs/). +The TD documentation can be found [here](https://daniil.it/MadelineProto/TD_docs/). (you cannot use the methods described here in MadelineProto without the lua extension) The MadelineProto API documentation (mtproto tl scheme) can be found [here](https://daniil.it/MadelineProto/MTProto_docs/). @@ -84,14 +84,21 @@ Thanks to the devs that contributed to these projects, MadelineProto is now an e ### RTFM -If you have some questions about the usage of the methods of this library, you can join the [support group](https://telegram.me/pwrtelegramgroup) or contact [@danogentili](https://telegram.me/danogentili). +If you have some questions about the usage of the methods of this library, you can join the [support group](https://telegram.me/pwrtelegramgroup) or contact [@danogentili](https://telegram.me/danogentili). -But first, please read this WHOLE page very carefully, follow all links to external documentation, and read all examples in the repo. +But first, please read this WHOLE page very carefully, follow all links to external documentation, and read all examples in the repo (bot.php, bots/, tests/testing.php). If you don't understand something, read everything again. +You MUST know OOP programming in order to use this library. + I will NOT answer to questions that can be answered simply by reading this page; I will instead ask you to read it carefully twice. +A very important page you must read is the [API documentation](https://daniil.it/MadelineProto/API_docs/): if it's the first time you see a link to that page it means you didn't read the documentation carefully. + +I can offer support, however, when it comes to MadelineProto bugs or problems in the documentation. I will not write code for you for free, however you can hire me to do that if you want (my rate is 50$ per hour); you can also buy an easy to use, customized MadelineProto base for only 30$. + +If you're selling a MadelineProto base too, you really should consider donating at least 20% of the price of the base: [this is my PayPal](https://paypal.me/danog). ### Installation @@ -447,6 +454,8 @@ Methods that allow sending message entities (messages.sendMessage for example) a To convert the results of methods to bot API objects you must provide a second parameter to method wrappers, containing an array with the `botAPI` key set to true. +To disable fetching the result of a method, the array that must be provided as second parameter to method wrapper must have the `noResponse` key set to true. + reply_markup accepts bot API reply markup objects as well as MTProto ones. Note that when you login as a bot, MadelineProto also logins using the [PWRTelegram](https://pwrtelegram.xyz) API, to allow persistant storage of peers, even after a logout and another login. diff --git a/log b/log deleted file mode 100644 index c35ee7f5..00000000 --- a/log +++ /dev/null @@ -1,89 +0,0 @@ -Deserializing MadelineProto from session.madeline... -MTProto, magnaluna: Resetting session id and seq_no in DC 2... -MTProto, magnaluna: Resetting session id and seq_no in DC 1... -MTProto, magnaluna: Resetting session id and seq_no in DC 3... -MTProto, magnaluna: Resetting session id and seq_no in DC 4... -MTProto, magnaluna: Resetting session id and seq_no in DC 5... -MTProto, magnaluna: Serialization is out of date, reconstructing object! -Exception, magnaluna: file_get_contents(http://ipv6.test-ipv6.com/): failed to open stream: Network is unreachable in MTProto.php:187 -TL, magnaluna: Loading TL schemes... -TL, magnaluna: Parsing TL_mtproto_v1.json... -TL, magnaluna: Parsing TL_telegram_v62.tl... -TL, magnaluna: Parsing TL_secret.tl... -TL, magnaluna: Parsing TL_td.tl... -TL, magnaluna: Parsing TL_botAPI.tl... -CallHandler, magnaluna: Calling method (try number 1 for help.getNearestDc)... -ResponseHandler, magnaluna: Received msg_container. -ResponseHandler, magnaluna: Received new_session_created. -CallHandler, magnaluna: Calling method (try number 1 for updates.getDifference)... -ResponseHandler, magnaluna: Received new_session_created. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 3, is 1, new_session_created) -ResponseHandler, magnaluna: Received rpc_result. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 5, is 3, nearestDc) -ResponseHandler, magnaluna: Received rpc_result. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 7, is 5, rpc_error) -Exception, magnaluna: Received request to switch to DC 1 in ResponseHandler.php:327 -CallHandler, magnaluna: An error occurred while calling method updates.getDifference: Received request to switch to DC 1 in ResponseHandler on line 327. Recreating connection and retrying to call method... -CallHandler, magnaluna: Calling method (try number 2 for updates.getDifference)... -ResponseHandler, magnaluna: Received msg_container. -ResponseHandler, magnaluna: Received new_session_created. -ResponseHandler, magnaluna: Received msgs_ack. -ResponseHandler, magnaluna: Received rpc_result. -UpdateHandler, magnaluna: Got updates.difference -MessageHandler, magnaluna: I do not have the secret chat -1302339158 in the database, skipping message... -MessageHandler, magnaluna: I do not have the secret chat -1302339158 in the database, skipping message... -UpdateHandler, magnaluna: Handling an update of type updateEncryptedMessagesRead... -UpdateHandler, magnaluna: Saving an update of type updateEncryptedMessagesRead... -ResponseHandler, magnaluna: Received msgs_ack. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 8, is 2, msgs_ack) -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 8, is 2, msg_container) -MTProto, magnaluna: We're in NL, current dc is 2, nearest dc is 4. -MTProto, magnaluna: Getting updates after deserialization... -CallHandler, magnaluna: Calling method (try number 1 for updates.getDifference)... -ResponseHandler, magnaluna: Received msg_container. -ResponseHandler, magnaluna: Received new_session_created. -ResponseHandler, magnaluna: Received msgs_ack. -ResponseHandler, magnaluna: Received rpc_result. -Exception, magnaluna: Received request to switch to DC 1 in ResponseHandler.php:327 -CallHandler, magnaluna: An error occurred while calling method updates.getDifference: Received request to switch to DC 1 in ResponseHandler on line 327. Recreating connection and retrying to call method... -CallHandler, magnaluna: Calling method (try number 2 for updates.getDifference)... -ResponseHandler, magnaluna: Received msg_container. -ResponseHandler, magnaluna: Received rpc_result. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 5, is 3, updates.difference) -ResponseHandler, magnaluna: Received msgs_ack. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 6, is 4, msgs_ack) -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 6, is 4, msg_container) -ResponseHandler, magnaluna: Received rpc_result. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 7, is 5, updates.differenceEmpty) -UpdateHandler, magnaluna: Got updates.differenceEmpty -Loading .env... -Loading settings... -Serializing MadelineProto to session.madeline... -Wrote 643125 bytes -Size of MadelineProto instance is 643125 bytes -AuthKeyHandler, magnaluna: Creating secret chat with 219474624... -CallHandler, magnaluna: Calling method (try number 1 for messages.getDhConfig)... -ResponseHandler, magnaluna: Received rpc_result. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 9, is 7, messages.dhConfig) -AuthKeyHandler, magnaluna: Executing p/g checks (1/2)... -AuthKeyHandler, magnaluna: Executing p/g checks (2/2)... -AuthKeyHandler, magnaluna: Executing g check... -AuthKeyHandler, magnaluna: Generating a... -AuthKeyHandler, magnaluna: Generating g_a... -AuthKeyHandler, magnaluna: Executing g_a check (1/2)... -AuthKeyHandler, magnaluna: Executing g_a check (2/2)... -CallHandler, magnaluna: Calling method (try number 1 for messages.requestEncryption)... -ResponseHandler, magnaluna: Received updateShort. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 11, is 9, updateShort) -ResponseHandler, magnaluna: Parsing updates received via the socket... -UpdateHandler, magnaluna: Handling an update of type updateUserStatus... -UpdateHandler, magnaluna: Saving an update of type updateUserStatus... -ResponseHandler, magnaluna: Received rpc_result. -SeqNoHandler, magnaluna: SECURITY WARNING: Seqno mismatch (should be 13, is 11, rpc_error) -PHP Fatal error: Uncaught danog\MadelineProto\RPCErrorException: FLOOD_WAIT_169 in /home/pwrtelegram/repos/repos/BruhhBot-Madeline/MadelineProto/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php:354 -Stack trace: -#0 /home/pwrtelegram/repos/repos/BruhhBot-Madeline/MadelineProto/src/danog/MadelineProto/MTProtoTools/CallHandler.php(93): danog\MadelineProto\MTProto->handle_rpc_error(Array, 1) -#1 /home/pwrtelegram/repos/repos/BruhhBot-Madeline/MadelineProto/src/danog/MadelineProto/SecretChats/AuthKeyHandler.php(55): danog\MadelineProto\MTProto->method_call('messages.reques...', Array, Array) -#2 /home/pwrtelegram/repos/repos/BruhhBot-Madeline/MadelineProto/tests/testing.php(74): danog\MadelineProto\MTProto->request_secret_chat(Array) -#3 {main} - thrown in /home/pwrtelegram/repos/repos/BruhhBot-Madeline/MadelineProto/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php on line 354 diff --git a/old_docs/API_docs_v18/methods/auth_sendInvites.md b/old_docs/API_docs_v18/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v18/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v18/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v18/methods/messages_sendBroadcast.md b/old_docs/API_docs_v18/methods/messages_sendBroadcast.md index 380f385b..7f36a823 100644 --- a/old_docs/API_docs_v18/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v18/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_StatedMessages = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_StatedMessages](../types/messages_StatedMessages.md) will be returned instead. + + diff --git a/old_docs/API_docs_v18/methods/messages_sendEncrypted.md b/old_docs/API_docs_v18/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v18/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v18/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v18/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v18/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v18/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v18/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v18/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v18/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v18/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v18/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v18/methods/messages_sendMessage.md b/old_docs/API_docs_v18/methods/messages_sendMessage.md index d3933d68..777d8ae9 100644 --- a/old_docs/API_docs_v18/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v18/methods/messages_sendMessage.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentMessage = messages.sendMessage({peer=InputPeer, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentMessage](../types/messages_SentMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v18/types/ContactStatus.md b/old_docs/API_docs_v18/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v18/types/ContactStatus.md +++ b/old_docs/API_docs_v18/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v18/types/README.md b/old_docs/API_docs_v18/types/README.md index 4204dd14..a0eed848 100644 --- a/old_docs/API_docs_v18/types/README.md +++ b/old_docs/API_docs_v18/types/README.md @@ -132,16 +132,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -178,6 +168,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_ChatFull](messages_ChatFull.md) diff --git a/old_docs/API_docs_v18/types/User.md b/old_docs/API_docs_v18/types/User.md index 3301b5b4..75da3b6f 100644 --- a/old_docs/API_docs_v18/types/User.md +++ b/old_docs/API_docs_v18/types/User.md @@ -26,11 +26,29 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[userSelf](../constructors/userSelf.md) + +[userContact](../constructors/userContact.md) + +[userRequest](../constructors/userRequest.md) + +[userForeign](../constructors/userForeign.md) + +[userDeleted](../constructors/userDeleted.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + diff --git a/old_docs/API_docs_v18/types/WallPaper.md b/old_docs/API_docs_v18/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v18/types/WallPaper.md +++ b/old_docs/API_docs_v18/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v23/methods/auth_sendInvites.md b/old_docs/API_docs_v23/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v23/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v23/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v23/methods/messages_sendBroadcast.md b/old_docs/API_docs_v23/methods/messages_sendBroadcast.md index 380f385b..7f36a823 100644 --- a/old_docs/API_docs_v23/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v23/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_StatedMessages = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_StatedMessages](../types/messages_StatedMessages.md) will be returned instead. + + diff --git a/old_docs/API_docs_v23/methods/messages_sendEncrypted.md b/old_docs/API_docs_v23/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v23/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v23/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v23/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v23/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v23/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v23/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v23/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v23/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v23/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v23/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v23/methods/messages_sendMessage.md b/old_docs/API_docs_v23/methods/messages_sendMessage.md index d3933d68..777d8ae9 100644 --- a/old_docs/API_docs_v23/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v23/methods/messages_sendMessage.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentMessage = messages.sendMessage({peer=InputPeer, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentMessage](../types/messages_SentMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v23/types/ContactStatus.md b/old_docs/API_docs_v23/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v23/types/ContactStatus.md +++ b/old_docs/API_docs_v23/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v23/types/README.md b/old_docs/API_docs_v23/types/README.md index d4b0af6f..2722d05a 100644 --- a/old_docs/API_docs_v23/types/README.md +++ b/old_docs/API_docs_v23/types/README.md @@ -150,16 +150,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -200,6 +190,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AllStickers](messages_AllStickers.md) diff --git a/old_docs/API_docs_v23/types/User.md b/old_docs/API_docs_v23/types/User.md index 3301b5b4..9e35e443 100644 --- a/old_docs/API_docs_v23/types/User.md +++ b/old_docs/API_docs_v23/types/User.md @@ -26,11 +26,33 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[userSelf](../constructors/userSelf.md) + +[userContact](../constructors/userContact.md) + +[userRequest](../constructors/userRequest.md) + +[userForeign](../constructors/userForeign.md) + +[userDeleted](../constructors/userDeleted.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->contacts->resolveUsername](../methods/contacts_resolveUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v23/types/WallPaper.md b/old_docs/API_docs_v23/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v23/types/WallPaper.md +++ b/old_docs/API_docs_v23/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v25/methods/auth_sendInvites.md b/old_docs/API_docs_v25/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v25/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v25/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v25/methods/geochats_sendMessage.md b/old_docs/API_docs_v25/methods/geochats_sendMessage.md index 6e58612a..4e49a020 100644 --- a/old_docs/API_docs_v25/methods/geochats_sendMessage.md +++ b/old_docs/API_docs_v25/methods/geochats_sendMessage.md @@ -43,3 +43,9 @@ Or, if you're into Lua: geochats_StatedMessage = geochats.sendMessage({peer=InputGeoChat, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [geochats\_StatedMessage](../types/geochats_StatedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v25/methods/messages_sendBroadcast.md b/old_docs/API_docs_v25/methods/messages_sendBroadcast.md index 380f385b..7f36a823 100644 --- a/old_docs/API_docs_v25/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v25/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_StatedMessages = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_StatedMessages](../types/messages_StatedMessages.md) will be returned instead. + + diff --git a/old_docs/API_docs_v25/methods/messages_sendEncrypted.md b/old_docs/API_docs_v25/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v25/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v25/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v25/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v25/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v25/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v25/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v25/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v25/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v25/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v25/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v25/methods/messages_sendMessage.md b/old_docs/API_docs_v25/methods/messages_sendMessage.md index 038fa7f2..87d4a00c 100644 --- a/old_docs/API_docs_v25/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v25/methods/messages_sendMessage.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentMessage = messages.sendMessage({peer=InputPeer, reply_to_msg_id=int, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentMessage](../types/messages_SentMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v25/types/ContactStatus.md b/old_docs/API_docs_v25/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v25/types/ContactStatus.md +++ b/old_docs/API_docs_v25/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v25/types/README.md b/old_docs/API_docs_v25/types/README.md index 902f06d8..1a1c7972 100644 --- a/old_docs/API_docs_v25/types/README.md +++ b/old_docs/API_docs_v25/types/README.md @@ -154,16 +154,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -208,6 +198,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v25/types/User.md b/old_docs/API_docs_v25/types/User.md index 3301b5b4..9e35e443 100644 --- a/old_docs/API_docs_v25/types/User.md +++ b/old_docs/API_docs_v25/types/User.md @@ -26,11 +26,33 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[userSelf](../constructors/userSelf.md) + +[userContact](../constructors/userContact.md) + +[userRequest](../constructors/userRequest.md) + +[userForeign](../constructors/userForeign.md) + +[userDeleted](../constructors/userDeleted.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->contacts->resolveUsername](../methods/contacts_resolveUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v25/types/WallPaper.md b/old_docs/API_docs_v25/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v25/types/WallPaper.md +++ b/old_docs/API_docs_v25/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v27/methods/auth_sendInvites.md b/old_docs/API_docs_v27/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v27/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v27/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v27/methods/geochats_sendMessage.md b/old_docs/API_docs_v27/methods/geochats_sendMessage.md index 6e58612a..4e49a020 100644 --- a/old_docs/API_docs_v27/methods/geochats_sendMessage.md +++ b/old_docs/API_docs_v27/methods/geochats_sendMessage.md @@ -43,3 +43,9 @@ Or, if you're into Lua: geochats_StatedMessage = geochats.sendMessage({peer=InputGeoChat, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [geochats\_StatedMessage](../types/geochats_StatedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v27/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v27/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v27/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v27/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v27/methods/messages_sendBroadcast.md b/old_docs/API_docs_v27/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v27/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v27/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v27/methods/messages_sendEncrypted.md b/old_docs/API_docs_v27/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v27/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v27/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v27/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v27/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v27/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v27/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v27/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v27/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v27/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v27/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v27/methods/messages_sendMessage.md b/old_docs/API_docs_v27/methods/messages_sendMessage.md index 5d7489fb..0b50d907 100644 --- a/old_docs/API_docs_v27/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v27/methods/messages_sendMessage.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentMessage = messages.sendMessage({peer=InputPeer, reply_to_msg_id=int, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentMessage](../types/messages_SentMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v27/types/ContactStatus.md b/old_docs/API_docs_v27/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v27/types/ContactStatus.md +++ b/old_docs/API_docs_v27/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v27/types/README.md b/old_docs/API_docs_v27/types/README.md index 00020392..ae1803f3 100644 --- a/old_docs/API_docs_v27/types/README.md +++ b/old_docs/API_docs_v27/types/README.md @@ -156,16 +156,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -220,6 +210,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v27/types/User.md b/old_docs/API_docs_v27/types/User.md index 3301b5b4..9e35e443 100644 --- a/old_docs/API_docs_v27/types/User.md +++ b/old_docs/API_docs_v27/types/User.md @@ -26,11 +26,33 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[userSelf](../constructors/userSelf.md) + +[userContact](../constructors/userContact.md) + +[userRequest](../constructors/userRequest.md) + +[userForeign](../constructors/userForeign.md) + +[userDeleted](../constructors/userDeleted.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->contacts->resolveUsername](../methods/contacts_resolveUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v27/types/WallPaper.md b/old_docs/API_docs_v27/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v27/types/WallPaper.md +++ b/old_docs/API_docs_v27/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v33/methods/auth_sendInvites.md b/old_docs/API_docs_v33/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v33/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v33/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v33/methods/geochats_sendMessage.md b/old_docs/API_docs_v33/methods/geochats_sendMessage.md index 6e58612a..4e49a020 100644 --- a/old_docs/API_docs_v33/methods/geochats_sendMessage.md +++ b/old_docs/API_docs_v33/methods/geochats_sendMessage.md @@ -43,3 +43,9 @@ Or, if you're into Lua: geochats_StatedMessage = geochats.sendMessage({peer=InputGeoChat, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [geochats\_StatedMessage](../types/geochats_StatedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v33/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v33/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v33/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v33/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v33/methods/messages_sendBroadcast.md b/old_docs/API_docs_v33/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v33/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v33/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v33/methods/messages_sendEncrypted.md b/old_docs/API_docs_v33/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v33/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v33/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v33/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v33/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v33/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v33/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v33/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v33/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v33/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v33/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v33/methods/messages_sendMessage.md b/old_docs/API_docs_v33/methods/messages_sendMessage.md index ef4bdd43..ea89516d 100644 --- a/old_docs/API_docs_v33/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v33/methods/messages_sendMessage.md @@ -51,3 +51,9 @@ messages_SentMessage = messages.sendMessage({peer=InputPeer, reply_to_msg_id=int You can provide bot API reply_markup objects here. + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentMessage](../types/messages_SentMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v33/types/ContactStatus.md b/old_docs/API_docs_v33/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v33/types/ContactStatus.md +++ b/old_docs/API_docs_v33/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v33/types/README.md b/old_docs/API_docs_v33/types/README.md index d5bd52fa..f6b296e4 100644 --- a/old_docs/API_docs_v33/types/README.md +++ b/old_docs/API_docs_v33/types/README.md @@ -176,18 +176,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -244,6 +232,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v33/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v33/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v33/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v33/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v33/types/User.md b/old_docs/API_docs_v33/types/User.md index 3301b5b4..70da4d34 100644 --- a/old_docs/API_docs_v33/types/User.md +++ b/old_docs/API_docs_v33/types/User.md @@ -26,11 +26,25 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->contacts->resolveUsername](../methods/contacts_resolveUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v33/types/WallPaper.md b/old_docs/API_docs_v33/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v33/types/WallPaper.md +++ b/old_docs/API_docs_v33/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v38/methods/auth_sendInvites.md b/old_docs/API_docs_v38/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v38/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v38/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v38/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v38/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v38/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v38/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v38/methods/messages_sendBroadcast.md b/old_docs/API_docs_v38/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v38/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v38/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v38/methods/messages_sendEncrypted.md b/old_docs/API_docs_v38/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v38/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v38/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v38/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v38/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v38/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v38/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v38/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v38/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v38/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v38/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v38/methods/messages_sendMessage.md b/old_docs/API_docs_v38/methods/messages_sendMessage.md index b84ae777..cf945004 100644 --- a/old_docs/API_docs_v38/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v38/methods/messages_sendMessage.md @@ -54,6 +54,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v38/types/ContactStatus.md b/old_docs/API_docs_v38/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v38/types/ContactStatus.md +++ b/old_docs/API_docs_v38/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v38/types/README.md b/old_docs/API_docs_v38/types/README.md index 148af090..47c5ddc7 100644 --- a/old_docs/API_docs_v38/types/README.md +++ b/old_docs/API_docs_v38/types/README.md @@ -184,18 +184,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -252,6 +240,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v38/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v38/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v38/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v38/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v38/types/User.md b/old_docs/API_docs_v38/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v38/types/User.md +++ b/old_docs/API_docs_v38/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v38/types/WallPaper.md b/old_docs/API_docs_v38/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v38/types/WallPaper.md +++ b/old_docs/API_docs_v38/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v40/methods/auth_sendInvites.md b/old_docs/API_docs_v40/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v40/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v40/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v40/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v40/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v40/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v40/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v40/methods/messages_sendBroadcast.md b/old_docs/API_docs_v40/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v40/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v40/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v40/methods/messages_sendEncrypted.md b/old_docs/API_docs_v40/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v40/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v40/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v40/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v40/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v40/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v40/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v40/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v40/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v40/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v40/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v40/methods/messages_sendMessage.md b/old_docs/API_docs_v40/methods/messages_sendMessage.md index b84ae777..cf945004 100644 --- a/old_docs/API_docs_v40/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v40/methods/messages_sendMessage.md @@ -54,6 +54,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v40/types/ContactStatus.md b/old_docs/API_docs_v40/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v40/types/ContactStatus.md +++ b/old_docs/API_docs_v40/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v40/types/README.md b/old_docs/API_docs_v40/types/README.md index 258fb636..9d96552c 100644 --- a/old_docs/API_docs_v40/types/README.md +++ b/old_docs/API_docs_v40/types/README.md @@ -180,18 +180,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -242,6 +230,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v40/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v40/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v40/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v40/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v40/types/User.md b/old_docs/API_docs_v40/types/User.md index 3301b5b4..70da4d34 100644 --- a/old_docs/API_docs_v40/types/User.md +++ b/old_docs/API_docs_v40/types/User.md @@ -26,11 +26,25 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->contacts->resolveUsername](../methods/contacts_resolveUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v40/types/WallPaper.md b/old_docs/API_docs_v40/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v40/types/WallPaper.md +++ b/old_docs/API_docs_v40/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v41/methods/auth_sendInvites.md b/old_docs/API_docs_v41/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v41/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v41/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v41/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v41/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v41/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v41/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v41/methods/messages_sendBroadcast.md b/old_docs/API_docs_v41/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v41/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v41/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v41/methods/messages_sendEncrypted.md b/old_docs/API_docs_v41/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v41/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v41/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v41/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v41/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v41/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v41/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v41/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v41/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v41/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v41/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v41/methods/messages_sendMessage.md b/old_docs/API_docs_v41/methods/messages_sendMessage.md index 074cb877..01218cc7 100644 --- a/old_docs/API_docs_v41/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v41/methods/messages_sendMessage.md @@ -56,6 +56,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v41/types/ContactStatus.md b/old_docs/API_docs_v41/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v41/types/ContactStatus.md +++ b/old_docs/API_docs_v41/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v41/types/README.md b/old_docs/API_docs_v41/types/README.md index 50932f5e..8cac7e34 100644 --- a/old_docs/API_docs_v41/types/README.md +++ b/old_docs/API_docs_v41/types/README.md @@ -186,18 +186,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -254,6 +242,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v41/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v41/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v41/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v41/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v41/types/User.md b/old_docs/API_docs_v41/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v41/types/User.md +++ b/old_docs/API_docs_v41/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v41/types/WallPaper.md b/old_docs/API_docs_v41/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v41/types/WallPaper.md +++ b/old_docs/API_docs_v41/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v42/methods/auth_sendInvites.md b/old_docs/API_docs_v42/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v42/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v42/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v42/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v42/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v42/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v42/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v42/methods/messages_sendBroadcast.md b/old_docs/API_docs_v42/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v42/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v42/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v42/methods/messages_sendEncrypted.md b/old_docs/API_docs_v42/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v42/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v42/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v42/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v42/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v42/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v42/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v42/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v42/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v42/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v42/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v42/methods/messages_sendMessage.md b/old_docs/API_docs_v42/methods/messages_sendMessage.md index 074cb877..01218cc7 100644 --- a/old_docs/API_docs_v42/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v42/methods/messages_sendMessage.md @@ -56,6 +56,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v42/types/ContactStatus.md b/old_docs/API_docs_v42/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v42/types/ContactStatus.md +++ b/old_docs/API_docs_v42/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v42/types/README.md b/old_docs/API_docs_v42/types/README.md index 50932f5e..8cac7e34 100644 --- a/old_docs/API_docs_v42/types/README.md +++ b/old_docs/API_docs_v42/types/README.md @@ -186,18 +186,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -254,6 +242,10 @@ description: List of types [help\_Support](help_Support.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v42/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v42/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v42/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v42/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v42/types/User.md b/old_docs/API_docs_v42/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v42/types/User.md +++ b/old_docs/API_docs_v42/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v42/types/WallPaper.md b/old_docs/API_docs_v42/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v42/types/WallPaper.md +++ b/old_docs/API_docs_v42/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v44/methods/auth_sendInvites.md b/old_docs/API_docs_v44/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v44/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v44/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v44/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v44/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v44/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v44/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v44/methods/messages_sendBroadcast.md b/old_docs/API_docs_v44/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v44/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v44/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v44/methods/messages_sendEncrypted.md b/old_docs/API_docs_v44/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v44/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v44/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v44/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v44/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v44/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v44/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v44/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v44/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v44/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v44/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v44/methods/messages_sendMessage.md b/old_docs/API_docs_v44/methods/messages_sendMessage.md index 074cb877..01218cc7 100644 --- a/old_docs/API_docs_v44/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v44/methods/messages_sendMessage.md @@ -56,6 +56,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v44/types/ContactStatus.md b/old_docs/API_docs_v44/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v44/types/ContactStatus.md +++ b/old_docs/API_docs_v44/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v44/types/README.md b/old_docs/API_docs_v44/types/README.md index 74a211b8..5b8ef9c6 100644 --- a/old_docs/API_docs_v44/types/README.md +++ b/old_docs/API_docs_v44/types/README.md @@ -190,18 +190,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -260,6 +248,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v44/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v44/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v44/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v44/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v44/types/User.md b/old_docs/API_docs_v44/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v44/types/User.md +++ b/old_docs/API_docs_v44/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v44/types/WallPaper.md b/old_docs/API_docs_v44/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v44/types/WallPaper.md +++ b/old_docs/API_docs_v44/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v45/methods/auth_sendInvites.md b/old_docs/API_docs_v45/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v45/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v45/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v45/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v45/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v45/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v45/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v45/methods/messages_sendBroadcast.md b/old_docs/API_docs_v45/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v45/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v45/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v45/methods/messages_sendEncrypted.md b/old_docs/API_docs_v45/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v45/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v45/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v45/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v45/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v45/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v45/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v45/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v45/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v45/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v45/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v45/methods/messages_sendMessage.md b/old_docs/API_docs_v45/methods/messages_sendMessage.md index 074cb877..01218cc7 100644 --- a/old_docs/API_docs_v45/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v45/methods/messages_sendMessage.md @@ -56,6 +56,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v45/types/ContactStatus.md b/old_docs/API_docs_v45/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v45/types/ContactStatus.md +++ b/old_docs/API_docs_v45/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v45/types/README.md b/old_docs/API_docs_v45/types/README.md index a67eec26..2317dbdb 100644 --- a/old_docs/API_docs_v45/types/README.md +++ b/old_docs/API_docs_v45/types/README.md @@ -198,18 +198,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -268,6 +256,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v45/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v45/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v45/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v45/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v45/types/User.md b/old_docs/API_docs_v45/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v45/types/User.md +++ b/old_docs/API_docs_v45/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v45/types/WallPaper.md b/old_docs/API_docs_v45/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v45/types/WallPaper.md +++ b/old_docs/API_docs_v45/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v46/methods/auth_sendInvites.md b/old_docs/API_docs_v46/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v46/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v46/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v46/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v46/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v46/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v46/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v46/methods/messages_sendBroadcast.md b/old_docs/API_docs_v46/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v46/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v46/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v46/methods/messages_sendEncrypted.md b/old_docs/API_docs_v46/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v46/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v46/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v46/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v46/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v46/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v46/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v46/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v46/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v46/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v46/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v46/methods/messages_sendMessage.md b/old_docs/API_docs_v46/methods/messages_sendMessage.md index 074cb877..01218cc7 100644 --- a/old_docs/API_docs_v46/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v46/methods/messages_sendMessage.md @@ -56,6 +56,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v46/types/ContactStatus.md b/old_docs/API_docs_v46/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v46/types/ContactStatus.md +++ b/old_docs/API_docs_v46/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v46/types/README.md b/old_docs/API_docs_v46/types/README.md index c92ce2b9..c0c3aff1 100644 --- a/old_docs/API_docs_v46/types/README.md +++ b/old_docs/API_docs_v46/types/README.md @@ -196,18 +196,6 @@ description: List of types [UserStatus](UserStatus.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [Video](Video.md) [WallPaper](WallPaper.md) @@ -266,6 +254,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v46/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v46/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v46/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v46/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v46/types/User.md b/old_docs/API_docs_v46/types/User.md index 3301b5b4..664ac56e 100644 --- a/old_docs/API_docs_v46/types/User.md +++ b/old_docs/API_docs_v46/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + diff --git a/old_docs/API_docs_v46/types/WallPaper.md b/old_docs/API_docs_v46/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v46/types/WallPaper.md +++ b/old_docs/API_docs_v46/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v51/methods/auth_sendInvites.md b/old_docs/API_docs_v51/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v51/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v51/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v51/methods/messages_editInlineBotMessage.md b/old_docs/API_docs_v51/methods/messages_editInlineBotMessage.md index ae98c13d..e6e74c03 100644 --- a/old_docs/API_docs_v51/methods/messages_editInlineBotMessage.md +++ b/old_docs/API_docs_v51/methods/messages_editInlineBotMessage.md @@ -54,6 +54,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v51/methods/messages_editMessage.md b/old_docs/API_docs_v51/methods/messages_editMessage.md index 3ce73b6c..574344cc 100644 --- a/old_docs/API_docs_v51/methods/messages_editMessage.md +++ b/old_docs/API_docs_v51/methods/messages_editMessage.md @@ -55,6 +55,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v51/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v51/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v51/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v51/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v51/methods/messages_sendBroadcast.md b/old_docs/API_docs_v51/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v51/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v51/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v51/methods/messages_sendEncrypted.md b/old_docs/API_docs_v51/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v51/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v51/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v51/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v51/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v51/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v51/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v51/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v51/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v51/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v51/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v51/methods/messages_sendMessage.md b/old_docs/API_docs_v51/methods/messages_sendMessage.md index c362ff14..7ae1b425 100644 --- a/old_docs/API_docs_v51/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v51/methods/messages_sendMessage.md @@ -58,6 +58,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v51/methods/messages_setBotCallbackAnswer.md b/old_docs/API_docs_v51/methods/messages_setBotCallbackAnswer.md index 554af885..828ff38f 100644 --- a/old_docs/API_docs_v51/methods/messages_setBotCallbackAnswer.md +++ b/old_docs/API_docs_v51/methods/messages_setBotCallbackAnswer.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Bool = messages.setBotCallbackAnswer({alert=Bool, query_id=long, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v51/types/ContactStatus.md b/old_docs/API_docs_v51/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v51/types/ContactStatus.md +++ b/old_docs/API_docs_v51/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v51/types/README.md b/old_docs/API_docs_v51/types/README.md index 69c79df0..3b9890ae 100644 --- a/old_docs/API_docs_v51/types/README.md +++ b/old_docs/API_docs_v51/types/README.md @@ -200,18 +200,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [WallPaper](WallPaper.md) [WebPage](WebPage.md) @@ -268,6 +256,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v51/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v51/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v51/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v51/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v51/types/User.md b/old_docs/API_docs_v51/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v51/types/User.md +++ b/old_docs/API_docs_v51/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v51/types/WallPaper.md b/old_docs/API_docs_v51/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v51/types/WallPaper.md +++ b/old_docs/API_docs_v51/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v53/methods/auth_sendInvites.md b/old_docs/API_docs_v53/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v53/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v53/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v53/methods/messages_editInlineBotMessage.md b/old_docs/API_docs_v53/methods/messages_editInlineBotMessage.md index ae98c13d..e6e74c03 100644 --- a/old_docs/API_docs_v53/methods/messages_editInlineBotMessage.md +++ b/old_docs/API_docs_v53/methods/messages_editInlineBotMessage.md @@ -54,6 +54,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v53/methods/messages_editMessage.md b/old_docs/API_docs_v53/methods/messages_editMessage.md index 3ce73b6c..574344cc 100644 --- a/old_docs/API_docs_v53/methods/messages_editMessage.md +++ b/old_docs/API_docs_v53/methods/messages_editMessage.md @@ -55,6 +55,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v53/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v53/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v53/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v53/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v53/methods/messages_saveDraft.md b/old_docs/API_docs_v53/methods/messages_saveDraft.md index c3324146..1c624176 100644 --- a/old_docs/API_docs_v53/methods/messages_saveDraft.md +++ b/old_docs/API_docs_v53/methods/messages_saveDraft.md @@ -48,6 +48,12 @@ Bool = messages.saveDraft({no_webpage=Bool, reply_to_msg_id=int, peer=InputPeer, ``` +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v53/methods/messages_sendBroadcast.md b/old_docs/API_docs_v53/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v53/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v53/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v53/methods/messages_sendEncrypted.md b/old_docs/API_docs_v53/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v53/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v53/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v53/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v53/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v53/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v53/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v53/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v53/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v53/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v53/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v53/methods/messages_sendMessage.md b/old_docs/API_docs_v53/methods/messages_sendMessage.md index e7f23e30..99f51a31 100644 --- a/old_docs/API_docs_v53/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v53/methods/messages_sendMessage.md @@ -58,6 +58,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v53/methods/messages_setBotCallbackAnswer.md b/old_docs/API_docs_v53/methods/messages_setBotCallbackAnswer.md index 554af885..828ff38f 100644 --- a/old_docs/API_docs_v53/methods/messages_setBotCallbackAnswer.md +++ b/old_docs/API_docs_v53/methods/messages_setBotCallbackAnswer.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Bool = messages.setBotCallbackAnswer({alert=Bool, query_id=long, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v53/types/ContactStatus.md b/old_docs/API_docs_v53/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v53/types/ContactStatus.md +++ b/old_docs/API_docs_v53/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v53/types/README.md b/old_docs/API_docs_v53/types/README.md index eac1d578..e4469b50 100644 --- a/old_docs/API_docs_v53/types/README.md +++ b/old_docs/API_docs_v53/types/README.md @@ -206,18 +206,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [WallPaper](WallPaper.md) [WebPage](WebPage.md) @@ -276,6 +264,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v53/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v53/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v53/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v53/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v53/types/User.md b/old_docs/API_docs_v53/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v53/types/User.md +++ b/old_docs/API_docs_v53/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v53/types/WallPaper.md b/old_docs/API_docs_v53/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v53/types/WallPaper.md +++ b/old_docs/API_docs_v53/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v55/methods/auth_sendInvites.md b/old_docs/API_docs_v55/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v55/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v55/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v55/methods/messages_editInlineBotMessage.md b/old_docs/API_docs_v55/methods/messages_editInlineBotMessage.md index ae98c13d..e6e74c03 100644 --- a/old_docs/API_docs_v55/methods/messages_editInlineBotMessage.md +++ b/old_docs/API_docs_v55/methods/messages_editInlineBotMessage.md @@ -54,6 +54,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v55/methods/messages_editMessage.md b/old_docs/API_docs_v55/methods/messages_editMessage.md index 3ce73b6c..574344cc 100644 --- a/old_docs/API_docs_v55/methods/messages_editMessage.md +++ b/old_docs/API_docs_v55/methods/messages_editMessage.md @@ -55,6 +55,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v55/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v55/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v55/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v55/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v55/methods/messages_saveDraft.md b/old_docs/API_docs_v55/methods/messages_saveDraft.md index c3324146..1c624176 100644 --- a/old_docs/API_docs_v55/methods/messages_saveDraft.md +++ b/old_docs/API_docs_v55/methods/messages_saveDraft.md @@ -48,6 +48,12 @@ Bool = messages.saveDraft({no_webpage=Bool, reply_to_msg_id=int, peer=InputPeer, ``` +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v55/methods/messages_sendBroadcast.md b/old_docs/API_docs_v55/methods/messages_sendBroadcast.md index b19bec57..2dfc9a3d 100644 --- a/old_docs/API_docs_v55/methods/messages_sendBroadcast.md +++ b/old_docs/API_docs_v55/methods/messages_sendBroadcast.md @@ -44,3 +44,9 @@ Or, if you're into Lua: Updates = messages.sendBroadcast({contacts={InputUser}, message=string, media=InputMedia, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + diff --git a/old_docs/API_docs_v55/methods/messages_sendEncrypted.md b/old_docs/API_docs_v55/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v55/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v55/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v55/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v55/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v55/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v55/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v55/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v55/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v55/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v55/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v55/methods/messages_sendMessage.md b/old_docs/API_docs_v55/methods/messages_sendMessage.md index e7f23e30..99f51a31 100644 --- a/old_docs/API_docs_v55/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v55/methods/messages_sendMessage.md @@ -58,6 +58,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v55/methods/messages_setBotCallbackAnswer.md b/old_docs/API_docs_v55/methods/messages_setBotCallbackAnswer.md index f2b71f4e..93cd070b 100644 --- a/old_docs/API_docs_v55/methods/messages_setBotCallbackAnswer.md +++ b/old_docs/API_docs_v55/methods/messages_setBotCallbackAnswer.md @@ -45,3 +45,9 @@ Or, if you're into Lua: Bool = messages.setBotCallbackAnswer({alert=Bool, query_id=long, message=string, url=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v55/types/ContactStatus.md b/old_docs/API_docs_v55/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v55/types/ContactStatus.md +++ b/old_docs/API_docs_v55/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v55/types/README.md b/old_docs/API_docs_v55/types/README.md index 498f8676..b6e57a92 100644 --- a/old_docs/API_docs_v55/types/README.md +++ b/old_docs/API_docs_v55/types/README.md @@ -208,20 +208,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[StickerSetCovered](StickerSetCovered.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [WallPaper](WallPaper.md) [WebPage](WebPage.md) @@ -280,6 +266,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v55/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v55/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v55/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v55/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v55/types/StickerSetCovered.md b/old_docs/API_docs_v55/types/StickerSetCovered.md index 36492c7e..3b7c36b4 100644 --- a/old_docs/API_docs_v55/types/StickerSetCovered.md +++ b/old_docs/API_docs_v55/types/StickerSetCovered.md @@ -9,6 +9,8 @@ description: constructors and methods of type StickerSetCovered ### Possible values (constructors): +[stickerSetCovered](../constructors/stickerSetCovered.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v55/types/User.md b/old_docs/API_docs_v55/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v55/types/User.md +++ b/old_docs/API_docs_v55/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v55/types/WallPaper.md b/old_docs/API_docs_v55/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v55/types/WallPaper.md +++ b/old_docs/API_docs_v55/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v57/methods/auth_sendInvites.md b/old_docs/API_docs_v57/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v57/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v57/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v57/methods/messages_editInlineBotMessage.md b/old_docs/API_docs_v57/methods/messages_editInlineBotMessage.md index ae98c13d..e6e74c03 100644 --- a/old_docs/API_docs_v57/methods/messages_editInlineBotMessage.md +++ b/old_docs/API_docs_v57/methods/messages_editInlineBotMessage.md @@ -54,6 +54,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v57/methods/messages_editMessage.md b/old_docs/API_docs_v57/methods/messages_editMessage.md index 3ce73b6c..574344cc 100644 --- a/old_docs/API_docs_v57/methods/messages_editMessage.md +++ b/old_docs/API_docs_v57/methods/messages_editMessage.md @@ -55,6 +55,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v57/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v57/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v57/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v57/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v57/methods/messages_saveDraft.md b/old_docs/API_docs_v57/methods/messages_saveDraft.md index c3324146..1c624176 100644 --- a/old_docs/API_docs_v57/methods/messages_saveDraft.md +++ b/old_docs/API_docs_v57/methods/messages_saveDraft.md @@ -48,6 +48,12 @@ Bool = messages.saveDraft({no_webpage=Bool, reply_to_msg_id=int, peer=InputPeer, ``` +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v57/methods/messages_sendEncrypted.md b/old_docs/API_docs_v57/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v57/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v57/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v57/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v57/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v57/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v57/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v57/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v57/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v57/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v57/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v57/methods/messages_sendMessage.md b/old_docs/API_docs_v57/methods/messages_sendMessage.md index e7f23e30..99f51a31 100644 --- a/old_docs/API_docs_v57/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v57/methods/messages_sendMessage.md @@ -58,6 +58,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v57/methods/messages_setBotCallbackAnswer.md b/old_docs/API_docs_v57/methods/messages_setBotCallbackAnswer.md index f2b71f4e..93cd070b 100644 --- a/old_docs/API_docs_v57/methods/messages_setBotCallbackAnswer.md +++ b/old_docs/API_docs_v57/methods/messages_setBotCallbackAnswer.md @@ -45,3 +45,9 @@ Or, if you're into Lua: Bool = messages.setBotCallbackAnswer({alert=Bool, query_id=long, message=string, url=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v57/types/ContactStatus.md b/old_docs/API_docs_v57/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v57/types/ContactStatus.md +++ b/old_docs/API_docs_v57/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v57/types/README.md b/old_docs/API_docs_v57/types/README.md index c3815256..c72b22e4 100644 --- a/old_docs/API_docs_v57/types/README.md +++ b/old_docs/API_docs_v57/types/README.md @@ -216,20 +216,6 @@ description: List of types [Vector t](Vector t.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[StickerSetCovered](StickerSetCovered.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [WallPaper](WallPaper.md) [WebPage](WebPage.md) @@ -288,6 +274,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v57/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v57/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v57/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v57/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v57/types/StickerSetCovered.md b/old_docs/API_docs_v57/types/StickerSetCovered.md index 5158b759..ef955281 100644 --- a/old_docs/API_docs_v57/types/StickerSetCovered.md +++ b/old_docs/API_docs_v57/types/StickerSetCovered.md @@ -9,6 +9,10 @@ description: constructors and methods of type StickerSetCovered ### Possible values (constructors): +[stickerSetCovered](../constructors/stickerSetCovered.md) + +[stickerSetMultiCovered](../constructors/stickerSetMultiCovered.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v57/types/User.md b/old_docs/API_docs_v57/types/User.md index 3301b5b4..ae4ca19c 100644 --- a/old_docs/API_docs_v57/types/User.md +++ b/old_docs/API_docs_v57/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + diff --git a/old_docs/API_docs_v57/types/WallPaper.md b/old_docs/API_docs_v57/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v57/types/WallPaper.md +++ b/old_docs/API_docs_v57/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/API_docs_v62/methods/auth_sendInvites.md b/old_docs/API_docs_v62/methods/auth_sendInvites.md index 87cdc7e3..d9b09e7a 100644 --- a/old_docs/API_docs_v62/methods/auth_sendInvites.md +++ b/old_docs/API_docs_v62/methods/auth_sendInvites.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = auth.sendInvites({phone_numbers={string}, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v62/methods/help_setBotUpdatesStatus.md b/old_docs/API_docs_v62/methods/help_setBotUpdatesStatus.md index 820d3c0f..f90469e2 100644 --- a/old_docs/API_docs_v62/methods/help_setBotUpdatesStatus.md +++ b/old_docs/API_docs_v62/methods/help_setBotUpdatesStatus.md @@ -43,3 +43,9 @@ Or, if you're into Lua: Bool = help.setBotUpdatesStatus({pending_updates_count=int, message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v62/methods/messages_editInlineBotMessage.md b/old_docs/API_docs_v62/methods/messages_editInlineBotMessage.md index ae98c13d..e6e74c03 100644 --- a/old_docs/API_docs_v62/methods/messages_editInlineBotMessage.md +++ b/old_docs/API_docs_v62/methods/messages_editInlineBotMessage.md @@ -54,6 +54,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v62/methods/messages_editMessage.md b/old_docs/API_docs_v62/methods/messages_editMessage.md index 3ce73b6c..574344cc 100644 --- a/old_docs/API_docs_v62/methods/messages_editMessage.md +++ b/old_docs/API_docs_v62/methods/messages_editMessage.md @@ -55,6 +55,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v62/methods/messages_getWebPagePreview.md b/old_docs/API_docs_v62/methods/messages_getWebPagePreview.md index a3d5fce3..14807ab2 100644 --- a/old_docs/API_docs_v62/methods/messages_getWebPagePreview.md +++ b/old_docs/API_docs_v62/methods/messages_getWebPagePreview.md @@ -42,3 +42,9 @@ Or, if you're into Lua: MessageMedia = messages.getWebPagePreview({message=string, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [MessageMedia](../types/MessageMedia.md) will be returned instead. + + diff --git a/old_docs/API_docs_v62/methods/messages_saveDraft.md b/old_docs/API_docs_v62/methods/messages_saveDraft.md index c3324146..1c624176 100644 --- a/old_docs/API_docs_v62/methods/messages_saveDraft.md +++ b/old_docs/API_docs_v62/methods/messages_saveDraft.md @@ -48,6 +48,12 @@ Bool = messages.saveDraft({no_webpage=Bool, reply_to_msg_id=int, peer=InputPeer, ``` +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v62/methods/messages_sendEncrypted.md b/old_docs/API_docs_v62/methods/messages_sendEncrypted.md index c3585580..3a87be14 100644 --- a/old_docs/API_docs_v62/methods/messages_sendEncrypted.md +++ b/old_docs/API_docs_v62/methods/messages_sendEncrypted.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncrypted({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v62/methods/messages_sendEncryptedFile.md b/old_docs/API_docs_v62/methods/messages_sendEncryptedFile.md index 40674df9..34932902 100644 --- a/old_docs/API_docs_v62/methods/messages_sendEncryptedFile.md +++ b/old_docs/API_docs_v62/methods/messages_sendEncryptedFile.md @@ -44,3 +44,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedFile({peer=InputEncryptedChat, message=DecryptedMessage, file=InputEncryptedFile, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v62/methods/messages_sendEncryptedService.md b/old_docs/API_docs_v62/methods/messages_sendEncryptedService.md index 8bfee571..3dbbd0a1 100644 --- a/old_docs/API_docs_v62/methods/messages_sendEncryptedService.md +++ b/old_docs/API_docs_v62/methods/messages_sendEncryptedService.md @@ -43,3 +43,9 @@ Or, if you're into Lua: messages_SentEncryptedMessage = messages.sendEncryptedService({peer=InputEncryptedChat, message=DecryptedMessage, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [messages\_SentEncryptedMessage](../types/messages_SentEncryptedMessage.md) will be returned instead. + + diff --git a/old_docs/API_docs_v62/methods/messages_sendMessage.md b/old_docs/API_docs_v62/methods/messages_sendMessage.md index e7f23e30..99f51a31 100644 --- a/old_docs/API_docs_v62/methods/messages_sendMessage.md +++ b/old_docs/API_docs_v62/methods/messages_sendMessage.md @@ -58,6 +58,12 @@ You can provide bot API reply_markup objects here. +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Updates](../types/Updates.md) will be returned instead. + + + ## Usage of parse_mode: Set parse_mode to html to enable HTML parsing of the message. diff --git a/old_docs/API_docs_v62/methods/messages_setBotCallbackAnswer.md b/old_docs/API_docs_v62/methods/messages_setBotCallbackAnswer.md index 73a43bf2..1b0c8cd2 100644 --- a/old_docs/API_docs_v62/methods/messages_setBotCallbackAnswer.md +++ b/old_docs/API_docs_v62/methods/messages_setBotCallbackAnswer.md @@ -46,3 +46,9 @@ Or, if you're into Lua: Bool = messages.setBotCallbackAnswer({alert=Bool, query_id=long, message=string, url=string, cache_time=int, }) ``` + +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of [Bool](../types/Bool.md) will be returned instead. + + diff --git a/old_docs/API_docs_v62/types/ContactStatus.md b/old_docs/API_docs_v62/types/ContactStatus.md index 7c59a43a..28257d0e 100644 --- a/old_docs/API_docs_v62/types/ContactStatus.md +++ b/old_docs/API_docs_v62/types/ContactStatus.md @@ -9,6 +9,8 @@ description: constructors and methods of type ContactStatus ### Possible values (constructors): +[contactStatus](../constructors/contactStatus.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v62/types/README.md b/old_docs/API_docs_v62/types/README.md index 0e7317c3..a1e4cd0f 100644 --- a/old_docs/API_docs_v62/types/README.md +++ b/old_docs/API_docs_v62/types/README.md @@ -232,20 +232,6 @@ description: List of types [UserStatus](UserStatus.md) -[ContactStatus](ContactStatus.md) - -[ReceivedNotifyMessage](ReceivedNotifyMessage.md) - -[StickerSetCovered](StickerSetCovered.md) - -[User](User.md) - -[WallPaper](WallPaper.md) - -[int](int.md) - -[long](long.md) - [WallPaper](WallPaper.md) [WebPage](WebPage.md) @@ -304,6 +290,10 @@ description: List of types [help\_TermsOfService](help_TermsOfService.md) +[int](int.md) + +[long](long.md) + [messages\_AffectedHistory](messages_AffectedHistory.md) [messages\_AffectedMessages](messages_AffectedMessages.md) diff --git a/old_docs/API_docs_v62/types/ReceivedNotifyMessage.md b/old_docs/API_docs_v62/types/ReceivedNotifyMessage.md index 16a1be6e..e403f2ab 100644 --- a/old_docs/API_docs_v62/types/ReceivedNotifyMessage.md +++ b/old_docs/API_docs_v62/types/ReceivedNotifyMessage.md @@ -9,6 +9,8 @@ description: constructors and methods of type ReceivedNotifyMessage ### Possible values (constructors): +[receivedNotifyMessage](../constructors/receivedNotifyMessage.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v62/types/StickerSetCovered.md b/old_docs/API_docs_v62/types/StickerSetCovered.md index 5158b759..ef955281 100644 --- a/old_docs/API_docs_v62/types/StickerSetCovered.md +++ b/old_docs/API_docs_v62/types/StickerSetCovered.md @@ -9,6 +9,10 @@ description: constructors and methods of type StickerSetCovered ### Possible values (constructors): +[stickerSetCovered](../constructors/stickerSetCovered.md) + +[stickerSetMultiCovered](../constructors/stickerSetMultiCovered.md) + ### Methods that return an object of this type (methods): diff --git a/old_docs/API_docs_v62/types/User.md b/old_docs/API_docs_v62/types/User.md index 3301b5b4..664ac56e 100644 --- a/old_docs/API_docs_v62/types/User.md +++ b/old_docs/API_docs_v62/types/User.md @@ -26,11 +26,23 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputUse ### Possible values (constructors): +[userEmpty](../constructors/userEmpty.md) + +[user](../constructors/user.md) + ### Methods that return an object of this type (methods): +[$MadelineProto->account->updateProfile](../methods/account_updateProfile.md) + +[$MadelineProto->account->updateUsername](../methods/account_updateUsername.md) + +[$MadelineProto->account->changePhone](../methods/account_changePhone.md) + [$MadelineProto->users->getUsers](../methods/users_getUsers.md) +[$MadelineProto->contacts->importCard](../methods/contacts_importCard.md) + diff --git a/old_docs/API_docs_v62/types/WallPaper.md b/old_docs/API_docs_v62/types/WallPaper.md index 5610100e..f213b9d5 100644 --- a/old_docs/API_docs_v62/types/WallPaper.md +++ b/old_docs/API_docs_v62/types/WallPaper.md @@ -17,5 +17,7 @@ description: constructors and methods of type WallPaper ### Methods that return an object of this type (methods): +[$MadelineProto->account->getWallPapers](../methods/account_getWallPapers.md) + diff --git a/old_docs/README.md b/old_docs/README.md index a4efac8b..c545f6a5 100644 --- a/old_docs/README.md +++ b/old_docs/README.md @@ -4,4 +4,4 @@ description: Documentation of old mtproto layers --- # Documentation of old mtproto layers -[Layer v62](API_docs_v62/) +[Layer v65](API_docs_v65/) diff --git a/src/danog/MadelineProto/API.php b/src/danog/MadelineProto/API.php index 37934842..e0181da3 100644 --- a/src/danog/MadelineProto/API.php +++ b/src/danog/MadelineProto/API.php @@ -35,77 +35,17 @@ class API extends APIFactory //$this->future_salts = $this->get_future_salts(['num' => 3]); $this->API->v = $this->API->getV(); \danog\MadelineProto\Logger::log(['MadelineProto is ready!'], Logger::NOTICE); - $this->setup_threads(); + } + public function __wakeup() { + //if (method_exists($this->API, 'wakeup')) $this->API = $this->API->wakeup(); + + $this->APIFactory(); } - /* - public function __sleep() - { - //$this->API->reset_session(false); - - return ['API']; - } - */ - public function setup_threads() - { - if ($this->API->threads = $this->API->run_workers = class_exists('\Pool') && php_sapi_name() == 'cli' && $this->API->settings['threading']['allow_threading']) { - \danog\MadelineProto\Logger::log(['THREADING IS ENABLED'], \danog\MadelineProto\Logger::NOTICE); - $this->start_threads(); - } - } - - public function start_threads() - { - if ($this->API->threads) { - $dcs = $this->API->datacenter->get_dcs(); - if (!isset($this->reader_pool)) { - $this->reader_pool = new \Pool(count($dcs)); - } - if (!isset($this->readers)) { - $this->readers = []; - } - foreach ($dcs as $dc) { - if (!isset($this->readers[$dc])) { - $this->readers[$dc] = new \danog\MadelineProto\Threads\SocketReader($this->API, $dc); - } - if (!$this->readers[$dc]->isRunning()) { - $this->readers[$dc]->garbage = false; - $this->reader_pool->submit($this->readers[$dc]); - Logger::log(['Socket reader on DC '.$dc.': RESTARTED'], Logger::WARNING); - } else { - Logger::log(['Socket reader on DC '.$dc.': WORKING'], Logger::NOTICE); - } - } - } - } - - public function __sleep() - { - $t = get_object_vars($this); - if (isset($t['reader_pool'])) { - unset($t['reader_pool']); - } - if (isset($t['readers'])) { - unset($t['readers']); - } - - return array_keys($t); - } - - public function __wakeup() - { - set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']); - $this->setup_threads(); - if (!isset($this->bots) || $this->bots === null) { - $this->APIFactory(); - } - } - - public function __destruct() - { + public function __destruct() { restore_error_handler(); } - + public function __sleep() { return ['API']; } public function APIFactory() { foreach ($this->API->get_method_namespaces() as $namespace) { diff --git a/src/danog/MadelineProto/DataCenter.php b/src/danog/MadelineProto/DataCenter.php index 9943f7da..505d3586 100644 --- a/src/danog/MadelineProto/DataCenter.php +++ b/src/danog/MadelineProto/DataCenter.php @@ -29,15 +29,15 @@ class DataCenter return ['sockets', 'curdc', 'dclist', 'settings']; } - public function __construct(&$dclist, &$settings) + public function __construct($dclist, $settings) { - $this->dclist = &$dclist; - $this->settings = &$settings; - foreach ($this->sockets as &$socket) { + //if ($this->unserialized($dclist)) return true; + $this->dclist = $dclist; + $this->settings = $settings; + foreach ($this->sockets as $socket) { $socket->close_and_reopen(); } } - public function dc_disconnect($dc_number) { if ($this->curdc === $dc_number) { @@ -55,36 +55,39 @@ class DataCenter if (isset($this->sockets[$dc_number])) { return false; } - $test = $this->settings[$dc_number]['test_mode'] ? 'test' : 'main'; - $ipv6 = $this->settings[$dc_number]['ipv6'] ? 'ipv6' : 'ipv4'; + $dc_config_number = isset($this->settings[$dc_number]) ? $dc_number : 'all'; + $test = $this->settings[$dc_config_number]['test_mode'] ? 'test' : 'main'; + $ipv6 = $this->settings[$dc_config_number]['ipv6'] ? 'ipv6' : 'ipv4'; $address = $this->dclist[$test][$ipv6][$dc_number]['ip_address']; - $address = $this->settings[$dc_number]['ipv6'] ? '['.$address.']' : $address; + $address = $this->settings[$dc_config_number]['ipv6'] ? '['.$address.']' : $address; $port = $this->dclist[$test][$ipv6][$dc_number]['port']; - if ($this->settings[$dc_number]['protocol'] === 'https') { - $subdomain = $this->dclist['ssl_subdomains'][$dc_number]; - $path = $this->settings[$dc_number]['test_mode'] ? 'apiw_test1' : 'apiw1'; - $address = $this->settings[$dc_number]['protocol'].'://'.$subdomain.'.web.telegram.org/'.$path; + if ($this->settings[$dc_config_number]['protocol'] === 'https') { + $subdomain = $this->dclist['ssl_subdomains'][$dc_config_number]; + $path = $this->settings[$dc_config_number]['test_mode'] ? 'apiw_test1' : 'apiw1'; + $address = $this->settings[$dc_config_number]['protocol'].'://'.$subdomain.'.web.telegram.org/'.$path; } - if ($this->settings[$dc_number]['protocol'] === 'http') { - $address = $this->settings[$dc_number]['protocol'].'://'.$address.'/api'; + if ($this->settings[$dc_config_number]['protocol'] === 'http') { + $address = $this->settings[$dc_config_number]['protocol'].'://'.$address.'/api'; $port = 80; } - \danog\MadelineProto\Logger::log(['Connecting to DC '.$dc_number.' ('.$test.' server, '.$ipv6.', '.$this->settings[$dc_number]['protocol'].')...'], \danog\MadelineProto\Logger::VERBOSE); + \danog\MadelineProto\Logger::log(['Connecting to DC '.$dc_number.' ('.$test.' server, '.$ipv6.', '.$this->settings[$dc_config_number]['protocol'].')...'], \danog\MadelineProto\Logger::VERBOSE); - $this->sockets[$dc_number] = new Connection($address, $port, $this->settings[$dc_number]['protocol'], $this->settings[$dc_number]['timeout']); + $this->sockets[$dc_number] = new Connection($address, $port, $this->settings[$dc_config_number]['protocol'], $this->settings[$dc_config_number]['timeout']); return true; } public function get_dcs() { - $test = $this->settings[2]['test_mode'] ? 'test' : 'main'; - $ipv6 = $this->settings[2]['ipv6'] ? 'ipv6' : 'ipv4'; + $test = $this->settings['all']['test_mode'] ? 'test' : 'main'; + $ipv6 = $this->settings['all']['ipv6'] ? 'ipv6' : 'ipv4'; return array_keys($this->dclist[$test][$ipv6]); } - + + + /* public function &__get($name) { return $this->sockets[$this->curdc]->{$name}; @@ -103,5 +106,5 @@ class DataCenter public function __call($name, $arguments) { return call_user_func_array([$this->sockets[$this->curdc], $name], $arguments); - } + }*/ } diff --git a/src/danog/MadelineProto/DocsBuilder.php b/src/danog/MadelineProto/DocsBuilder.php index 47fa04dd..775a76b9 100755 --- a/src/danog/MadelineProto/DocsBuilder.php +++ b/src/danog/MadelineProto/DocsBuilder.php @@ -76,11 +76,11 @@ description: '.$this->settings['description'].' $rtype = $this->methods->type[$key]; $type = str_replace(['.', '<', '>'], ['_', '_of_', ''], $rtype); $real_type = preg_replace('/.*_of_/', '', $type); - if (!isset($types[$rtype])) { - $types[$rtype] = ['constructors' => [], 'methods' => []]; + if (!isset($types[$real_type])) { + $types[$real_type] = ['constructors' => [], 'methods' => []]; } - if (!in_array($key, $types[$rtype]['methods'])) { - $types[$rtype]['methods'][] = $key; + if (!in_array($key, $types[$real_type]['methods'])) { + $types[$real_type]['methods'][] = $key; } $params = ''; @@ -140,6 +140,7 @@ description: '.$this->settings['description'].' $hasentities = false; $hasreplymarkup = false; + $hasmessage = false; foreach ($this->methods->params[$key] as $param) { if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) { continue; @@ -171,6 +172,9 @@ description: '.$this->settings['description'].' if ($param['name'] === 'reply_markup') { $hasreplymarkup = true; } + if ($param['name'] === 'message') { + $hasmessage = true; + } if ($param['name'] === 'entities') { $hasentities = true; $table .= '|parse\_mode| [string](../types/string.md) | Optional | @@ -231,6 +235,15 @@ Or, if you\'re into Lua: You can provide bot API reply_markup objects here. +'; + } + if ($hasmessage) { + $example .= ' +## Return value + +If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of ['.str_replace('_', '\_', $type).'](../types/'.$real_type.'.md) will be returned instead. + + '; } if ($hasentities) { @@ -312,17 +325,20 @@ description: List of methods } $layer = isset($this->constructors->layer[$key]) ? '_'.$this->constructors->layer[$key] : ''; $rtype = $this->constructors->type[$key]; - if (!isset($types[$rtype])) { - $types[$rtype] = ['constructors' => [], 'methods' => []]; - } - if (!in_array($key, $types[$rtype]['constructors'])) { - $types[$rtype]['constructors'][] = $key; - } + $type = str_replace(['.', '<', '>'], ['_', '_of_', ''], $rtype); $real_type = preg_replace('/.*_of_/', '', $type); $constructor = str_replace(['.', '<', '>'], ['_', '_of_', ''], $rconstructor); $real_constructor = preg_replace('/.*_of_/', '', $constructor); + if (!isset($types[$real_type])) { + $types[$real_type] = ['constructors' => [], 'methods' => []]; + } + if (!in_array($key, $types[$real_type]['constructors'])) { + $types[$real_type]['constructors'][] = $key; + } + + $params = ''; foreach ($this->constructors->params[$key] as $param) { if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) { @@ -508,6 +524,7 @@ description: List of constructors \danog\MadelineProto\Logger::log(['Generating types documentation...'], \danog\MadelineProto\Logger::NOTICE); foreach ($types as $otype => $keys) { + $new_namespace = preg_replace('/_.*/', '', $method); $br = $new_namespace != $last_namespace ? '***

' : ''; @@ -585,6 +602,7 @@ $'.$type.' = -147286699; // Numeric chat id returned by request_secret_chat, can '.$methods.' '; +if (file_exists('types/'.$type.'.md')) var_dump($type); file_put_contents('types/'.$type.'.md', $header.$constructors.$methods); $last_namespace = $new_namespace; } diff --git a/src/danog/MadelineProto/InternalDoc.php b/src/danog/MadelineProto/InternalDoc.php index 93806165..78ebba14 100644 --- a/src/danog/MadelineProto/InternalDoc.php +++ b/src/danog/MadelineProto/InternalDoc.php @@ -1600,6 +1600,27 @@ interface upload * @return upload_WebFile */ public function getWebFile(array $params); + + /** + * @param array params [ + * bytes file_token, + * int offset, + * int limit, + * ] + * + * @return upload_CdnFile + */ + public function getCdnFile(array $params); + + /** + * @param array params [ + * bytes file_token, + * bytes request_token, + * ] + * + * @return bool + */ + public function reuploadCdnFile(array $params); } interface help @@ -1661,6 +1682,11 @@ interface help * @return bool */ public function setBotUpdatesStatus(array $params); + + /** + * @return CdnConfig + */ + public function getCdnConfig(); } interface channels diff --git a/src/danog/MadelineProto/Logger.php b/src/danog/MadelineProto/Logger.php index 6b1751b3..6ae16d94 100644 --- a/src/danog/MadelineProto/Logger.php +++ b/src/danog/MadelineProto/Logger.php @@ -37,13 +37,13 @@ class Logger * 2 - Log to file defined in second parameter * 3 - Echo logs */ - public static function constructor(&$mode, &$optional = null, $prefix = '', $level = self::NOTICE) + public static function constructor($mode, $optional = null, $prefix = '', $level = self::NOTICE) { if ($mode === null) { throw new Exception('No mode was specified!'); } - self::$mode = &$mode; - self::$optional = &$optional; + self::$mode = $mode; + self::$optional = $optional; self::$constructed = true; self::$prefix = $prefix === '' ? '' : ', '.$prefix; self::$level = $level; diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 5c159ebf..4a7e8015 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -51,9 +51,10 @@ class MTProto public $bigint = false; public $run_workers = false; public $threads = false; - + public function __construct($settings = []) { + //if ($this->unserialized($settings)) return true; $this->bigint = PHP_INT_SIZE < 8; // Parse settings $this->parse_settings($settings); @@ -67,7 +68,8 @@ class MTProto } // Load rsa key \danog\MadelineProto\Logger::log(['Loading RSA key...'], Logger::ULTRA_VERBOSE); - $this->key = new RSA($this->settings['authorization']['rsa_key']); + $key = new RSA($this->settings['authorization']['rsa_key']); + $this->rsa_keys[$key->fp] = $key; // Istantiate TL class \danog\MadelineProto\Logger::log(['Translating tl schemas...'], Logger::ULTRA_VERBOSE); @@ -87,6 +89,8 @@ class MTProto $this->twoe2047 = new \phpseclib\Math\BigInteger('16158503035655503650357438344334975980222051334857742016065172713762327569433945446598600705761456731844358980460949009747059779575245460547544076193224141560315438683650498045875098875194826053398028819192033784138396109321309878080919047169238085235290822926018152521443787945770532904303776199561965192760957166694834171210342487393282284747428088017663161029038902829665513096354230157075129296432088558362971801859230928678799175576150822952201848806616643615613562842355410104862578550863465661734839271290328348967522998634176499319107762583194718667771801067716614802322659239302476074096777926805529798115328'); $this->twoe2048 = new \phpseclib\Math\BigInteger('32317006071311007300714876688669951960444102669715484032130345427524655138867890893197201411522913463688717960921898019494119559150490921095088152386448283120630877367300996091750197750389652106796057638384067568276792218642619756161838094338476170470581645852036305042887575891541065808607552399123930385521914333389668342420684974786564569494856176035326322058077805659331026192708460314150258592864177116725943603718461857357598351152301645904403697613233287231227125684710820209725157101726931323469678542580656697935045997268352998638215525166389437335543602135433229604645318478604952148193555853611059596230656'); + $this->setup_threads(); + $this->connect_to_all_dcs(); $this->datacenter->curdc = 2; @@ -103,48 +107,106 @@ class MTProto $this->v = $this->getV(); $this->should_serialize = true; } + + public function __sleep() + { + $t = get_object_vars($this); + if (isset($t['reader_pool'])) { + unset($t['reader_pool']); + } + if (isset($t['readers'])) { + unset($t['readers']); + } + + return array_keys($t); + } public function __wakeup() { + set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']); + $this->setup_logger(); if (class_exists('\Thread') && method_exists('\Thread', 'getCurrentThread') && is_object(\Thread::getCurrentThread())) { return; } + /* + if (method_exists($this->datacenter, 'wakeup')) $this->datacenter = $this->datacenter->wakeup(); + foreach ($this->rsa_keys as $key => $elem) { + if (method_exists($elem, 'wakeup')) $this->rsa_keys[$key] = $elem->wakeup(); + } + foreach ($this->datacenter->sockets as $key => $elem) { + if (method_exists($elem, 'wakeup')) $this->datacenter->sockets[$key] = $elem->wakeup(); + } + */ $this->bigint = PHP_INT_SIZE < 8; - $this->setup_logger(); $this->reset_session(); if (!isset($this->v) || $this->v !== $this->getV()) { \danog\MadelineProto\Logger::log(['Serialization is out of date, reconstructing object!'], Logger::WARNING); $settings = $this->settings; + if (isset($settings['updates']['callback'][0]) && $settings['updates']['callback'][0] === $this) $settings['updates']['callback'] = 'get_updates_update_handler'; unset($settings['tl_schema']); + $this->reset_session(true, true); $this->__construct($settings); } $this->datacenter->__construct($this->settings['connection'], $this->settings['connection_settings']); + $this->setup_threads(); if ($this->authorized && $this->settings['updates']['handle_updates']) { \danog\MadelineProto\Logger::log(['Getting updates after deserialization...'], Logger::NOTICE); $this->get_updates_difference(); } + } public function __destruct() { if (isset($this->reader_pool)) { $this->run_workers = false; - while ($this->reader_pool->collect()); - \danog\MadelineProto\Logger::log(['Shutting down reader pool...'], Logger::NOTICE); + while ($number = $this->reader_pool->collect()) { + \danog\MadelineProto\Logger::log(['Shutting down reader pool, '.$number .' jobs left'], \danog\MadelineProto\Logger::NOTICE); + } $this->reader_pool->shutdown(); } } + public function setup_threads() + { + if ($this->threads = $this->run_workers = class_exists('\Pool') && in_array(php_sapi_name(), ['cli', 'phpdbg']) && $this->settings['threading']['allow_threading'] && extension_loaded("pthreads")) { + \danog\MadelineProto\Logger::log(['THREADING IS ENABLED'], \danog\MadelineProto\Logger::NOTICE); + $this->start_threads(); + } + } + + public function start_threads() + { + if ($this->threads) { + $dcs = $this->datacenter->get_dcs(); + if (!isset($this->reader_pool)) { + $this->reader_pool = new \Pool(count($dcs)); + } + if (!isset($this->readers)) { + $this->readers = []; + } + foreach ($dcs as $dc) { + if (!isset($this->readers[$dc])) { + $this->readers[$dc] = new \danog\MadelineProto\Threads\SocketReader($this, $dc); + } + if (!$this->readers[$dc]->isRunning()) { + $this->readers[$dc]->garbage = false; + $this->reader_pool->submit($this->readers[$dc]); + var_dump('hey'); + Logger::log(['Socket reader on DC '.$dc.': RESTARTED'], Logger::WARNING); + while (!$this->readers[$dc]->ready); + } else { + Logger::log(['Socket reader on DC '.$dc.': WORKING'], Logger::NOTICE); + } + } + } + } public function parse_settings($settings) { // Detect ipv6 $google = ''; try { - $ctx = stream_context_create(['http'=> [ - 'timeout' => 1, - ], - ]); - $google = file_get_contents('http://ipv6.test-ipv6.com/', false, $ctx); + $google = file_get_contents('http://ipv6.test-ipv6.com/', false, stream_context_create(['http' => ['timeout' => 1]])); } catch (Exception $e) { } $this->ipv6 = strlen($google) > 0; @@ -239,10 +301,10 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB 'lang_code' => 'en', ], 'tl_schema' => [ // TL scheme files - 'layer' => 65, // layer version + 'layer' => 66, // layer version 'src' => [ 'mtproto' => __DIR__.'/TL_mtproto_v1.json', // mtproto TL scheme - 'telegram' => __DIR__.'/TL_telegram_v65.tl', // telegram TL scheme + 'telegram' => __DIR__.'/TL_telegram_v66.tl', // telegram TL scheme 'secret' => __DIR__.'/TL_secret.tl', // secret chats TL scheme 'calls' => __DIR__.'/TL_calls.tl', // calls TL scheme 'td' => __DIR__.'/TL_td.tl', // telegram-cli TL scheme @@ -277,7 +339,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB 'peer' => ['full_info_cache_time' => 60], 'updates' => [ 'handle_updates' => true, // Should I handle updates? - 'callback' => [$this, 'get_updates_update_handler'], // A callable function that will be called every time an update is received, must accept an array (for the update) as the only parameter + 'callback' => 'get_updates_update_handler', // A callable function that will be called every time an update is received, must accept an array (for the update) as the only parameter ], 'secret_chats' => [ 'accept_chats' => true, // Should I accept secret chats? Can be true, false or on array of user ids from which to accept chats @@ -292,15 +354,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB ], 'pwr' => ['pwr' => false, 'db_token' => false, 'strict' => false], ]; - $settings = array_replace_recursive($default_settings, $settings); - if (isset($settings['connection_settings']['all'])) { - for ($n = 1; $n <= 6; $n++) { - if (!isset($settings['connection_settings'][$n])) { - $settings['connection_settings'][$n] = $settings['connection_settings']['all']; - } - } - unset($settings['connection_settings']['all']); - } + $settings = $this->array_replace_recursive($default_settings, $settings); switch ($settings['logger']['logger_level']) { case 'ULTRA_VERBOSE': $settings['logger']['logger_level'] = 5; break; case 'VERBOSE': $settings['logger']['logger_level'] = 4; break; @@ -310,8 +364,8 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB case 'FATAL ERROR': $settings['logger']['logger_level'] = 0; break; } + $this->settings = $settings; - // Setup logger $this->setup_logger(); $this->should_serialize = true; @@ -319,18 +373,25 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB public function setup_logger() { - \danog\MadelineProto\Logger::constructor($this->settings['logger']['logger'], $this->settings['logger']['logger_param'], isset($this->authorization['user']) ? (isset($this->authorization['user']['username']) ? $this->authorization['user']['username'] : $this->authorization['user']['id']) : '', isset($this->settings['logger']['logger_level']) ? $this->settings['logger']['logger_level'] : Logger::VERBOSE); + + \danog\MadelineProto\Logger::constructor( +$this->settings['logger']['logger'], + $this->settings['logger']['logger_param'], +isset($this->authorization['user']) ? (isset($this->authorization['user']['username']) ? $this->authorization['user']['username'] : $this->authorization['user']['id']) : '', isset($this->settings['logger']['logger_level']) ? $this->settings['logger']['logger_level'] : Logger::VERBOSE); } - public function reset_session($de = true) + public function reset_session($de = true, $auth_key = false) { - foreach ($this->datacenter->sockets as $id => &$socket) { + foreach ($this->datacenter->sockets as $id => $socket) { if ($de) { - \danog\MadelineProto\Logger::log(['Resetting session id and seq_no in DC '.$id.'...'], Logger::VERBOSE); + \danog\MadelineProto\Logger::log(['Resetting session id'.($auth_key ? ', authorization key':'').' and seq_no in DC '.$id.'...'], Logger::VERBOSE); $socket->session_id = $this->random(8); $socket->session_in_seq_no = 0; $socket->session_out_seq_no = 0; } + if ($auth_key) { + $socket->temp_auth_key = null; + } $socket->incoming_messages = []; $socket->outgoing_messages = []; $socket->new_outgoing = []; @@ -352,11 +413,13 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB $this->connect_to_all_dcs(); } } - + private $initing_authorization = false; // Creates authorization keys public function init_authorization() { - foreach ($this->datacenter->sockets as $id => &$socket) { + $this->initing_authorization = true; + foreach ($this->datacenter->sockets as $id => $socket) { + if (strpos($id, 'media')) continue; if ($socket->session_id === null) { $socket->session_id = $this->random(8); $socket->session_in_seq_no = 0; @@ -378,14 +441,16 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB $this->should_serialize = true; } } + $this->initing_authorization = true; } public function sync_authorization($authorized_dc) { - foreach ($this->datacenter->sockets as $new_dc => &$socket) { - if ($new_dc === $authorized_dc) { + foreach ($this->datacenter->sockets as $new_dc => $socket) { + if (($int_dc = preg_replace('|/D+|', '', $new_dc)) == $authorized_dc) { continue; } + if ($int_dc != $new_dc) continue; \danog\MadelineProto\Logger::log(['Copying authorization from dc '.$authorized_dc.' to dc '.$new_dc.'...'], Logger::VERBOSE); $this->should_serialize = true; $exported_authorization = $this->method_call('auth.exportAuthorization', ['dc_id' => $new_dc], ['datacenter' => $authorized_dc]); @@ -402,11 +467,16 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB 'invokeWithLayer', [ 'layer' => $this->settings['tl_schema']['layer'], - 'query' => $this->serialize_method('initConnection', - array_merge( - $this->settings['app_info'], - ['query' => $this->serialize_method($method, $arguments)] - ) + 'query' => $this->serialize_method('initConnection', + [ + 'api_id' => $this->settings['app_info']['api_id'], + 'api_hash' => $this->settings['app_info']['api_hash'], + 'device_model' => strpos($options['datacenter'], 'cdn') === false ? $this->settings['app_info']['device_model'] : "n/a", + 'system_version' => strpos($options['datacenter'], 'cdn') === false ? $this->settings['app_info']['system_version'] : "n/a", + 'app_version' => $this->settings['app_info']['app_version'], + 'lang_code' => $this->settings['app_info']['lang_code'], + 'query' => $this->serialize_method($method, $arguments) + ] ), ], $options @@ -429,14 +499,16 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB unset($this->config['dc_options']); \danog\MadelineProto\Logger::log(['Updated config!', $this->config], Logger::NOTICE); } - + public function parse_dc_options($dc_options) { foreach ($dc_options as $dc) { $test = $this->config['test_mode'] ? 'test' : 'main'; - $ipv6 = ($dc['ipv6'] ? 'ipv6' : 'ipv4'); $id = $dc['id']; - $test .= (isset($this->settings['connection'][$test][$ipv6][$id]) && $this->settings['connection'][$test][$ipv6][$id]['ip_address'] != $dc['ip_address']) ? '_bk' : ''; + $id .= $dc['cdn'] ? '_cdn' : ''; + $id .= $dc['media_only'] ? '_media' : ''; + $ipv6 = ($dc['ipv6'] ? 'ipv6' : 'ipv4'); + $id .= (isset($this->settings['connection'][$test][$ipv6][$id]) && $this->settings['connection'][$test][$ipv6][$id]['ip_address'] != $dc['ip_address']) ? '_bk' : ''; $this->settings['connection'][$test][$ipv6][$id] = $dc; } $this->should_serialize = true; @@ -444,7 +516,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB public function getV() { - return 12; + return 23; } public function get_self() diff --git a/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php b/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php index 1349358f..aa49b919 100644 --- a/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php @@ -61,15 +61,31 @@ trait AuthKeyHandler throw new \danog\MadelineProto\SecurityException('wrong nonce'); } + /* + * *********************************************************************** + * Fetch RSA keys for CDN datacenters + */ + if (strpos($datacenter, 'cdn') !== false) { + foreach ($this->method_call('help.getCdnConfig', [], ['datacenter' => $datacenter])['public_keys'] as $curkey) { + $tempkey = new \danog\MadelineProto\RSA($curkey['public_key']); + $this->rsa_keys[$tempkey->fp] = $tempkey; + $this->should_serialize = true; + } + } + /* * *********************************************************************** * Find our key in the server_public_key_fingerprints vector */ - if (!isset($this->key->keydata['fp'])) { - $this->key = new \danog\MadelineProto\RSA($this->settings['authorization']['rsa_key']); + + foreach ($this->rsa_keys as $fp => $curkey) { + if (in_array($fp, $ResPQ['server_public_key_fingerprints'])) { + $key = $curkey; + } } - if (!in_array($this->key->keydata['fp'], $ResPQ['server_public_key_fingerprints'])) { - throw new \danog\MadelineProto\SecurityException("Couldn't find our key in the server_public_key_fingerprints vector."); + + if (!isset($key)) { + throw new \danog\MadelineProto\SecurityException("Couldn't find any of our keys in the server_public_key_fingerprints vector."); } $pq_bytes = $ResPQ['pq']; $server_nonce = $ResPQ['server_nonce']; @@ -118,7 +134,7 @@ trait AuthKeyHandler $sha_digest = sha1($p_q_inner_data, true); $random_bytes = $this->random(255 - strlen($p_q_inner_data) - strlen($sha_digest)); $to_encrypt = $sha_digest.$p_q_inner_data.$random_bytes; - $encrypted_data = $this->key->encrypt($to_encrypt); + $encrypted_data = $key->encrypt($to_encrypt); \danog\MadelineProto\Logger::log(['Starting Diffie Hellman key exchange'], \danog\MadelineProto\Logger::VERBOSE); /* @@ -147,7 +163,7 @@ trait AuthKeyHandler 'server_nonce' => $server_nonce, 'p' => $p_bytes, 'q' => $q_bytes, - 'public_key_fingerprint' => $this->key->keydata['fp'], + 'public_key_fingerprint' => $key->fp, 'encrypted_data' => $encrypted_data, ], ['datacenter' => $datacenter] diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index 0b24eed4..3dd747ac 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -28,6 +28,10 @@ trait CallHandler if (!isset($aargs['datacenter'])) { throw new \danog\MadelineProto\Exception('No datacenter provided'); } + if (isset($args['message']) && mb_strlen($args['message']) > 4096) { + $message_chunks = $this->split_to_chunks($args['message']); + $args['message'] = array_shift($message_chunks); + } $args = $this->botAPI_to_MTProto($args); if (isset($args['ping_id']) && is_int($args['ping_id'])) { $args['ping_id'] = \danog\PHP\Struct::pack('serialize_method($method, $args); $content_related = $this->content_related($method); $type = $this->methods->find_by_method($method)['type']; + $last_recv = $this->last_recv; for ($count = 1; $count <= $this->settings['max_tries']['query']; $count++) { try { \danog\MadelineProto\Logger::log(['Calling method (try number '.$count.' for '.$method.')...'], \danog\MadelineProto\Logger::VERBOSE); $int_message_id = $this->send_message($serialized, $content_related, $aargs); - if ($method === 'http_wait') { + if ($method === 'http_wait' || (isset($aargs['noResponse']) && $aargs['noResponse'])) { return true; } $this->datacenter->sockets[$aargs['datacenter']]->outgoing_messages[$int_message_id]['content'] = ['method' => $method, 'args' => $args]; @@ -56,9 +61,11 @@ trait CallHandler $server_answer = null; $update_count = 0; $only_updates = false; + if ($canunset = !$this->getting_state && !$this->threads && !$this->run_workers) $this->getting_state = true; while ($server_answer === null && $res_count++ < $this->settings['max_tries']['response'] + 1) { // Loop until we get a response, loop for a max of $this->settings['max_tries']['response'] times try { \danog\MadelineProto\Logger::log(['Getting response (try number '.$res_count.' for '.$method.')...'], \danog\MadelineProto\Logger::ULTRA_VERBOSE); + //sleep(2); //$this->start_threads(); if (!isset($this->datacenter->sockets[$aargs['datacenter']]->outgoing_messages[$int_message_id]['response']) || !isset($this->datacenter->sockets[$aargs['datacenter']]->incoming_messages[$this->datacenter->sockets[$aargs['datacenter']]->outgoing_messages[$int_message_id]['response']]['content'])) { // Checks if I have received the response to the called method, if not continue looping if ($only_updates) { @@ -74,10 +81,10 @@ trait CallHandler $this->datacenter->sockets[$aargs['datacenter']]->incoming_messages[$this->datacenter->sockets[$aargs['datacenter']]->outgoing_messages[$int_message_id]['response']]['content'] = []; break; } - //if (!$this->threads && !$this->run_workers) { + if (!$this->threads && !$this->run_workers) { $this->recv_message($aargs['datacenter']); // This method receives data from the socket, and parses stuff $only_updates = $this->handle_messages($aargs['datacenter']); // This method receives data from the socket, and parses stuff - //} + } } catch (\danog\MadelineProto\Exception $e) { if ($e->getMessage() === 'I had to recreate the temporary authorization key') { continue 2; @@ -89,6 +96,11 @@ trait CallHandler continue; } } + + if ($canunset) { + $this->getting_state = false; + $this->handle_pending_updates(); + } if ($server_answer === null) { throw new \danog\MadelineProto\Exception("Couldn't get response"); } @@ -145,13 +157,30 @@ trait CallHandler unset($this->datacenter->sockets[$aargs['datacenter']]->outgoing_messages[$int_message_id]); unset($this->datacenter->sockets[$aargs['datacenter']]->new_outgoing[$int_message_id]); } + if ($canunset) { + $this->getting_state = false; + $this->handle_pending_updates(); + } } + if ($server_answer === null) { + if ($last_recv === $this->last_recv && $this->datacenter->sockets[$args['datacenter']]->temp_auth_key != null) { + \danog\MadelineProto\Logger::log(['WARNING: Resetting auth key...'], \danog\MadelineProto\Logger::WARNING); + $this->datacenter->sockets[$args['datacenter']]->temp_auth_key = null; + $this->init_authorization(); + return $this->method_call($method, $args, $aargs); + } throw new \danog\MadelineProto\Exception('An error occurred while calling method '.$method.' ('.$last_error.').'); } \danog\MadelineProto\Logger::log(['Got response for method '.$method.' @ try '.$count.' (response try '.$res_count.')'], \danog\MadelineProto\Logger::ULTRA_VERBOSE); $this->datacenter->sockets[$aargs['datacenter']]->outgoing_messages[$int_message_id] = []; - + if (isset($message_chunks) && count($message_chunks)) { + $server_answer = [$server_answer]; + foreach ($message_chunks as $message) { + $args['message'] = $message; + $server_answer []= $this->method_call($method, $args, $aargs); + } + } return $server_answer; } diff --git a/src/danog/MadelineProto/MTProtoTools/Crypt.php b/src/danog/MadelineProto/MTProtoTools/Crypt.php index 7fa5aa71..e5a9b241 100644 --- a/src/danog/MadelineProto/MTProtoTools/Crypt.php +++ b/src/danog/MadelineProto/MTProtoTools/Crypt.php @@ -35,6 +35,16 @@ trait Crypt return $cipher->encrypt($message); } + + public function ctr_encrypt($message, $key, $iv, $length) + { + $cipher = new \phpseclib\Crypt\AES(\phpseclib\Crypt\AES::MODE_CTR); + $iv .= \danog\PHP\Struct::pack('setKey($key); + $cipher->setIV($iv); + + return $cipher->encrypt($message); + } public function ige_decrypt($message, $key, $iv) { diff --git a/src/danog/MadelineProto/MTProtoTools/Files.php b/src/danog/MadelineProto/MTProtoTools/Files.php index 272d7a2d..da82daf5 100644 --- a/src/danog/MadelineProto/MTProtoTools/Files.php +++ b/src/danog/MadelineProto/MTProtoTools/Files.php @@ -53,11 +53,14 @@ trait Files $ige->setKey($key); $ige->enableContinuousBuffer(); } + $ctx = hash_init('md5'); + while (ftell($f) !== $file_size) { $bytes = stream_get_contents($f, $part_size); if ($encrypted === true) { $bytes = $ige->encrypt(str_pad($bytes, $part_size, chr(0))); } + hash_update($ctx, $bytes); if (!$this->method_call($method, ['file_id' => $file_id, 'file_part' => $part_num++, 'file_total_parts' => $part_total_num, 'bytes' => $bytes], ['heavy' => true, 'datacenter' => $datacenter])) { throw new \danog\MadelineProto\Exception('An error occurred while uploading file part '.$part_num); } @@ -65,12 +68,12 @@ trait Files } fclose($f); - $constructor = ['_' => $constructor, 'id' => $file_id, 'parts' => $part_total_num, 'name' => $file_name, 'md5_checksum' => md5_file($file)]; + $constructor = ['_' => $constructor, 'id' => $file_id, 'parts' => $part_total_num, 'name' => $file_name, 'md5_checksum' => hash_final($ctx)]; if ($encrypted === true) { $constructor['key_fingerprint'] = $fingerprint; $constructor['key'] = $key; $constructor['iv'] = $iv; - $constructor['md5_checksum'] = ''; +// $constructor['md5_checksum'] = ''; } return $constructor; @@ -261,10 +264,10 @@ trait Files $ige->enableContinuousBuffer(); } $theend = false; + $cdn = false; while (true) { - //$real_part_size = (($offset + $part_size > $end) && $end !== -1) ? $part_size - (($offset + $part_size) - $end) : $part_size; try { - $res = $this->method_call('upload.getFile', ['location' => $info['InputFileLocation'], 'offset' => $offset, 'limit' => $part_size], ['heavy' => true, 'datacenter' => $datacenter]); + $res = $cdn ? $this->method_call('upload.getCdnFile', ['file_token' => $info['file_token'], 'offset' => $offset, 'limit' => $part_size], ['heavy' => true, 'datacenter' => $datacenter]) : $this->method_call('upload.getFile', ['location' => $info['InputFileLocation'], 'offset' => $offset, 'limit' => $part_size], ['heavy' => true, 'datacenter' => $datacenter]); } catch (\danog\MadelineProto\RPCErrorException $e) { if ($e->getMessage() === 'OFFSET_INVALID') { break; @@ -272,14 +275,31 @@ trait Files throw $e; } } + if ($res['_'] === 'upload.fileCdnRedirect') { + $cdn = true; + $info['file_token'] = $res['file_token']; + $info['cdn_key'] = $res['key']; + $info['cdn_iv'] = $res['iv']; + $datacenter = $res['dc_id'].'_cdn'; + \danog\MadelineProto\Logger::log(['File is stored on CDN!'], \danog\MadelineProto\Logger::NOTICE); + continue; + } + if ($res['type']['_'] === 'upload.cdnFileReuploadNeeded') { + \danog\MadelineProto\Logger::log(['File is not stored on CDN, requesting reupload!'], \danog\MadelineProto\Logger::NOTICE); + $this->method_call('upload.reuploadCdnFile', ['file_token' => $info['file_token'], 'request_token' => $res['request_token']], ['heavy' => true, 'datacenter' => $datacenter]); + continue; + } while ($res['type']['_'] === 'storage.fileUnknown' && $res['bytes'] === '') { $datacenter = 1; - $res = $this->method_call('upload.getFile', ['location' => $info['InputFileLocation'], 'offset' => $offset, 'limit' => $real_part_size], ['heavy' => true, 'datacenter' => $datacenter]); + $res = $this->method_call('upload.getFile', ['location' => $info['InputFileLocation'], 'offset' => $offset, 'limit' => $part_size], ['heavy' => true, 'datacenter' => $datacenter]); $datacenter++; } if ($res['bytes'] === '') { break; } + if (isset($info['cdn_key'])) { + $res['bytes'] = $this->encrypt_ctr($res['bytes'], $info['cdn_key'], $info['cdn_iv'], $offset); + } if (isset($info['key'])) { $res['bytes'] = $ige->decrypt($res['bytes']); } diff --git a/src/danog/MadelineProto/MTProtoTools/MessageHandler.php b/src/danog/MadelineProto/MTProtoTools/MessageHandler.php index 72bef71b..444766b8 100644 --- a/src/danog/MadelineProto/MTProtoTools/MessageHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/MessageHandler.php @@ -21,6 +21,7 @@ trait MessageHandler * Forming the message frame and sending message to server * :param message: byte string to send. */ + private $last_recv = 0; public function send_message($message_data, $content_related, $aargs = []) { if (!isset($aargs['message_id']) || $aargs['message_id'] === null) { @@ -54,6 +55,7 @@ trait MessageHandler */ public function recv_message($datacenter) { + $payload = $this->datacenter->sockets[$datacenter]->read_message(); if (strlen($payload) === 4) { $error = \danog\PHP\Struct::unpack('datacenter->sockets[$datacenter]->incoming_messages[$message_id]['content'] = $deserialized; $this->datacenter->sockets[$datacenter]->incoming_messages[$message_id]['response'] = -1; $this->datacenter->sockets[$datacenter]->new_incoming[$message_id] = $message_id; + $this->last_recv = time(); } } diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index cdcb90f7..4d783d7e 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -93,7 +93,7 @@ trait PeerHandler try { return isset($this->chats[$this->get_info($id)['bot_api_id']]); } catch (\danog\MadelineProto\Exception $e) { - return false; + return $e->getMessage() === 'Chat forbidden'; } catch (\danog\MadelineProto\RPCErrorException $e) { return false; } @@ -180,15 +180,16 @@ trait PeerHandler break; } } - - if (preg_match('/^channel#/', $id)) { - $id = $this->to_supergroup(preg_replace('|\D+|', '', $id)); - } - if (preg_match('/^chat#/', $id)) { - $id = preg_replace('|\D+|', '-', $id); - } - if (preg_match('/^user#/', $id)) { - $id = preg_replace('|\D+|', '', $id); + if (is_string($id) && strpos('#', $id) !== false) { + if (preg_match('/^channel#/', $id)) { + $id = $this->to_supergroup(preg_replace('|\D+|', '', $id)); + } + if (preg_match('/^chat#/', $id)) { + $id = preg_replace('|\D+|', '-', $id); + } + if (preg_match('/^user#/', $id)) { + $id = preg_replace('|\D+|', '', $id); + } } if (is_numeric($id)) { @@ -262,6 +263,10 @@ trait PeerHandler $res['bot_api_id'] = $this->to_supergroup($constructor['id']); $res['type'] = $constructor['megagroup'] ? 'supergroup' : 'channel'; break; + case 'channelForbidden': + throw new \danog\MadelineProto\Exception('Chat forbidden'); + break; + default: throw new \danog\MadelineProto\Exception('Invalid constructor given '.var_export($constructor, true)); break; @@ -311,7 +316,7 @@ trait PeerHandler switch ($full['type']) { case 'user': case 'bot': - foreach (['first_name', 'last_name', 'username', 'verified', 'restricted', 'restriction_reason', 'status', 'bot_inline_placeholder', 'access_hash', 'phone'] as $key) { + foreach (['first_name', 'last_name', 'username', 'verified', 'restricted', 'restriction_reason', 'status', 'bot_inline_placeholder', 'access_hash', 'phone', 'lang_code'] as $key) { if (isset($full['User'][$key])) { $res[$key] = $full['User'][$key]; } diff --git a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php index a5e5dd20..94e86e11 100644 --- a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php @@ -137,7 +137,7 @@ trait ResponseHandler $only_updates = false; $this->datacenter->sockets[$datacenter]->temp_auth_key['server_salt'] = $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['server_salt']; $this->ack_incoming_message_id($current_msg_id, $datacenter); // Acknowledge that I received the server's response - if ($this->authorized) { + if ($this->authorized && !$this->initing_authorization && $this->datacenter->sockets[$this->datacenter->curdc]->temp_auth_key !== null) { $this->force_get_updates_difference(); } unset($this->datacenter->sockets[$datacenter]->new_incoming[$current_msg_id]); @@ -358,9 +358,12 @@ trait ResponseHandler public function handle_pending_updates() { - \danog\MadelineProto\Logger::log(['Parsing pending updates...'], \danog\MadelineProto\Logger::VERBOSE); - foreach ($this->pending_updates as $updates) { - $this->handle_updates($updates); + if (count($this->pending_updates)) { + \danog\MadelineProto\Logger::log(['Parsing pending updates...'], \danog\MadelineProto\Logger::VERBOSE); + foreach ($this->pending_updates as $key => $updates) { + unset($this->pending_updates[$key]); + $this->handle_updates($updates); + } } } diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index b9fe6c38..90ba76cf 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -142,7 +142,11 @@ trait UpdateHandler } catch (\danog\MadelineProto\RPCErrorException $e) { return false; } - $difference = $this->method_call('updates.getChannelDifference', ['channel' => $input, 'filter' => ['_' => 'channelMessagesFilterEmpty'], 'pts' => $this->get_channel_state($channel)['pts'], 'limit' => 30], ['datacenter' => $this->datacenter->curdc]); + try { + $difference = $this->method_call('updates.getChannelDifference', ['channel' => $input, 'filter' => ['_' => 'channelMessagesFilterEmpty'], 'pts' => $this->get_channel_state($channel)['pts'], 'limit' => 30], ['datacenter' => $this->datacenter->curdc]); + } catch (\danog\MadelineProto\RPCErrorException $e) { + if ($e->getMessage() === 'CHANNEL_PRIVATE') return false; else throw $e; + } \danog\MadelineProto\Logger::log(['Got '.$difference['_']], \danog\MadelineProto\Logger::VERBOSE); $this->get_channel_state($channel)['sync_loading'] = false; switch ($difference['_']) { @@ -580,7 +584,7 @@ trait UpdateHandler if (isset($this->settings['pwr']['strict']) && $this->settings['pwr']['strict']) { $this->pwr_update_handler($update); } else { - $this->settings['updates']['callback']($update); + $this->settings['updates']['callback'] === 'get_updates_update_handler' ? $this->get_updates_update_handler($update) : $this->settings['updates']['callback']($update); } } diff --git a/src/danog/MadelineProto/RSA.php b/src/danog/MadelineProto/RSA.php index e1837cf5..48fde473 100644 --- a/src/danog/MadelineProto/RSA.php +++ b/src/danog/MadelineProto/RSA.php @@ -17,41 +17,45 @@ class RSA use \danog\MadelineProto\TL\TL; use \danog\MadelineProto\Tools; - public $keydata = []; + public $e; + public $n; + public $fp; public function __construct($rsa_key) { + //if ($this->unserialized($rsa_key)) return true; \danog\MadelineProto\Logger::log(['Istantiating \phpseclib\Crypt\RSA...'], Logger::ULTRA_VERBOSE); $key = new \phpseclib\Crypt\RSA(); \danog\MadelineProto\Logger::log(['Loading key...'], Logger::ULTRA_VERBOSE); $key->load($rsa_key); - $this->keydata = ['n' => \phpseclib\Common\Functions\Objects::getVar($key, 'modulus'), 'e' => \phpseclib\Common\Functions\Objects::getVar($key, 'exponent')]; + $this->n = \phpseclib\Common\Functions\Objects::getVar($key, 'modulus'); + $this->e = \phpseclib\Common\Functions\Objects::getVar($key, 'exponent'); \danog\MadelineProto\Logger::log(['Computing fingerprint...'], Logger::ULTRA_VERBOSE); - $this->keydata['fp'] = substr( + $this->fp = substr( sha1( $this->serialize_object( ['type' => 'bytes'], - $this->keydata['n']->toBytes() + $this->n->toBytes() ) . $this->serialize_object( ['type' => 'bytes'], - $this->keydata['e']->toBytes() + $this->e->toBytes() ), true ), -8 ); - return $this->keydata; + return true; } public function encrypt($data) { \danog\MadelineProto\Logger::log(['Encrypting with rsa key...'], Logger::VERBOSE); - return (new \phpseclib\Math\BigInteger($data, 256))->powMod($this->keydata['e'], $this->keydata['n'])->toBytes(); + return (new \phpseclib\Math\BigInteger($data, 256))->powMod($this->e, $this->n)->toBytes(); } } diff --git a/src/danog/MadelineProto/Serialization.php b/src/danog/MadelineProto/Serialization.php index 830f0a31..333a05bc 100644 --- a/src/danog/MadelineProto/Serialization.php +++ b/src/danog/MadelineProto/Serialization.php @@ -54,6 +54,13 @@ class Serialization $file = fopen($filename, 'r+'); flock($file, LOCK_SH); $unserialized = stream_get_contents($file); + /* + foreach (['MTProto', 'DataCenter', 'Connection', 'RSA'] as $class) { + $oclass = "danog\\MadelineProto\\".$class; + $nclass = $oclass.'Serializable'; + $unserialized = str_replace('O:'.strlen($oclass).':"'.$oclass.'":', 'O:'.strlen($nclass).':"'.$nclass.'":', $unserialized); + } + */ flock($file, LOCK_UN); fclose($file); $unserialized = unserialize($unserialized); diff --git a/src/danog/MadelineProto/Stream.php b/src/danog/MadelineProto/Stream.php index 9f5b748f..ea05f795 100644 --- a/src/danog/MadelineProto/Stream.php +++ b/src/danog/MadelineProto/Stream.php @@ -13,7 +13,7 @@ If not, see . namespace danog\MadelineProto; /** - * Manages connection to telegram servers. + * Just a stream wrapper */ class Stream { diff --git a/src/danog/MadelineProto/TL/Conversion/BotAPI.php b/src/danog/MadelineProto/TL/Conversion/BotAPI.php index 7e8daeb1..9d3ea5b0 100644 --- a/src/danog/MadelineProto/TL/Conversion/BotAPI.php +++ b/src/danog/MadelineProto/TL/Conversion/BotAPI.php @@ -448,4 +448,35 @@ trait BotAPI return $arguments; } + function split_to_chunks($text){ + $total_length = 4096; + $text_arr = multipleExplodeKeepDelimiters(array("\n"),$text); + $i=0; + $message[0]=""; + foreach ($text_arr as $word){ + if ( strlen($message[$i] . $word . ' ') <= $total_length ){ + if ($text_arr[count($text_arr)-1] == $word){ + $message[$i] .= $word; + } else { + $message[$i] .= $word . ' '; + } + } else { + $i++; + if ($text_arr[count($text_arr)-1] == $word){ + $message[$i] = $word; + } else { + $message[$i] = $word . ' '; + } + } + } + return $message; + } +function multipleExplodeKeepDelimiters($delimiters, $string) { + $initialArray = explode(chr(1), str_replace($delimiters, chr(1), $string)); + $finalArray = array(); + foreach($initialArray as $item) { + if(strlen($item) > 0) array_push($finalArray, $item . $string[strpos($string, $item) + strlen($item)]); + } + return $finalArray; +} } diff --git a/src/danog/MadelineProto/TL/Conversion/Extension.php b/src/danog/MadelineProto/TL/Conversion/Extension.php index a2d2bdd6..4b746b5c 100644 --- a/src/danog/MadelineProto/TL/Conversion/Extension.php +++ b/src/danog/MadelineProto/TL/Conversion/Extension.php @@ -417,7 +417,8 @@ trait Extension public function get_extension_from_location($location, $default) { - $res = $this->method_call('upload.getFile', ['location' => $location, 'offset' => 0, 'limit' => 1], ['heavy' => true, 'datacenter' => $location['dc_id']]); + return $default; + $res = $this->method_call('upload.getFile', ['location' => $location, 'offset' => 0, 'limit' => 2], ['heavy' => true, 'datacenter' => $location['dc_id']]); if (!isset($res['type']['_'])) { return $default; } diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index bec27367..4d26a623 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -182,8 +182,9 @@ trait TL if ($this->constructors->find_by_id($id) === false) { unset($this->td_descriptions['constructors'][$name]); } else { - foreach ($this->td_descriptions['constructors'][$name]['params'] as &$param) { - $param = str_replace('nullable', 'optional', $param); + if (!count($this->td_descriptions['constructors'][$name]['params'])) continue; + foreach ($this->td_descriptions['constructors'][$name]['params'] as $k => $param) { + $this->td_descriptions['constructors'][$name]['params'][$k] = str_replace('nullable', 'optional', $param); } } } @@ -192,8 +193,8 @@ trait TL if ($this->methods->find_by_id($id) === false) { unset($this->td_descriptions['methods'][$name]); } else { - foreach ($this->td_descriptions['methods'][$name]['params'] as &$param) { - $param = str_replace('nullable', 'optional', $param); + foreach ($this->td_descriptions['methods'][$name]['params'] as $k => $param) { + $this->td_descriptions['constructors'][$name]['params'][$k] = str_replace('nullable', 'optional', $param); } } } @@ -241,11 +242,7 @@ trait TL return str_pad(strrev($object->toBytes()), 8, chr(0)); } - if (is_string($object)) { - if (strlen($object) !== 8) { - throw new Exception('Given value is not 8 bytes long'); - } - + if (is_string($object) && strlen($object) === 8) { return $object; } diff --git a/src/danog/MadelineProto/TL/TLParams.php b/src/danog/MadelineProto/TL/TLParams.php index 77279cbd..f1e51216 100644 --- a/src/danog/MadelineProto/TL/TLParams.php +++ b/src/danog/MadelineProto/TL/TLParams.php @@ -16,7 +16,7 @@ class TLParams { public function parse_params($key, $mtproto = false) { - foreach ($this->params[$key] as &$param) { + foreach ($this->params[$key] as $kkey => $param) { $param['flag'] = false; if (preg_match('/^flags\.\d*\?/', $param['type'])) { $param['flag'] = true; @@ -38,6 +38,7 @@ class TLParams } $param['type'] = (($mtproto && $param['type'] === 'Message') ? 'MT' : '').$param['type']; $param['type'] = (($mtproto && $param['type'] === '%Message') ? '%MTMessage' : $param['type']); + $this->params[$key][$kkey] = $param; } } } diff --git a/src/danog/MadelineProto/TL_telegram_v65.tl b/src/danog/MadelineProto/TL_telegram_v65.tl index 270b5bab..5d2e7e87 100644 --- a/src/danog/MadelineProto/TL_telegram_v65.tl +++ b/src/danog/MadelineProto/TL_telegram_v65.tl @@ -871,7 +871,7 @@ auth.sendInvites#771c1d97 phone_numbers:Vector message:string = Bool; auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization; auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization; auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool; -auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization; +auth.importBotAuthorization#67a3ff2c flags:int a:flags.0?true b:flags.0?true c:flags.0?true d:flags.0?true api_id:int api_hash:string bot_auth_token:string = auth.Authorization; auth.checkPassword#a63011e password_hash:bytes = auth.Authorization; auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery; auth.recoverPassword#4ea56e92 code:string = auth.Authorization; diff --git a/src/danog/MadelineProto/Threads/SocketReader.php b/src/danog/MadelineProto/Threads/SocketReader.php index 9c14f710..9d204e47 100644 --- a/src/danog/MadelineProto/Threads/SocketReader.php +++ b/src/danog/MadelineProto/Threads/SocketReader.php @@ -17,10 +17,14 @@ namespace danog\MadelineProto\Threads; */ class SocketReader extends \Threaded implements \Collectable { + public $ready = false; public function __construct($me, $current) { + return; $this->API = $me; $this->current = $current; + + var_dump('OK'); } public function __sleep() @@ -38,6 +42,8 @@ class SocketReader extends \Threaded implements \Collectable */ public function run() { +var_dump("BLOCK"); + while (true); require_once __DIR__.'/../SecurityException.php'; require_once __DIR__.'/../RPCErrorException.php'; require_once __DIR__.'/../ResponseException.php'; @@ -45,16 +51,21 @@ class SocketReader extends \Threaded implements \Collectable require_once __DIR__.'/../TL/Exception.php'; require_once __DIR__.'/../NothingInTheSocketException.php'; require_once __DIR__.'/../Exception.php'; + $handler_pool = new \Pool($this->API->settings['threading']['handler_workers']); - while ($this->API->run_workers) { - try { - $this->API->recv_message($this->current); - $handler_pool->submit(new SocketHandler($this->API, $this->current)); - } catch (\danog\MadelineProto\NothingInTheSocketException $e) { - } + $this->ready = true; + + //while ($this->API->run_workers) { + //try { + //var_dump('READING'); + // $this->API->recv_message($this->current); + // $handler_pool->submit(new SocketHandler($this->API, $this->current)); + //} catch (\danog\MadelineProto\NothingInTheSocketException $e) { \danog\MadelineProto\Logger::log(['Nothing in the socket for dc '.$this->current], \danog\MadelineProto\Logger::VERBOSE); } + //} + while ($number = $handler_pool->collect()) { + \danog\MadelineProto\Logger::log(['Shutting down handler pool for dc '.$this->current.', '.$number .' jobs left'], \danog\MadelineProto\Logger::NOTICE); } - while ($handler_pool->collect()); $this->setGarbage(); } diff --git a/src/danog/MadelineProto/Tools.php b/src/danog/MadelineProto/Tools.php index 2edcba22..f7ccc989 100644 --- a/src/danog/MadelineProto/Tools.php +++ b/src/danog/MadelineProto/Tools.php @@ -44,7 +44,7 @@ trait Tools { if (is_array($d)) { foreach ($d as $k => $v) { - $d[$k] = $this->utf8ize($v); + if ($k === 'bytes') $d[$k] = $this->utf8ize($v); } } elseif (is_string($d)) { return utf8_encode($d); @@ -57,4 +57,15 @@ trait Tools { return is_array($elem) || (is_object($elem) && get_class($elem) === 'Volatile'); } + public function array_replace_recursive($a, ...$b) { + return array_replace_recursive($this->array_cast_recursive($a), ...$this->array_cast_recursive($b)); + } + public function array_cast_recursive($array) { + if ($this->is_array($array)) { + if (!is_array($array)) $array = $array; + foreach ($array as $key => $value) { $array[$key] = $this->array_cast_recursive($value); } + } + return $array; + } } + diff --git a/tests/testing.php b/tests/testing.php index 2b196edb..51121b76 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -21,7 +21,7 @@ $MadelineProto = false; try { $MadelineProto = \danog\MadelineProto\Serialization::deserialize('session.madeline'); } catch (\danog\MadelineProto\Exception $e) { - var_dump($e); + var_dump($e->getMessage()); } if (file_exists('.env')) { echo 'Loading .env...'.PHP_EOL; @@ -57,19 +57,25 @@ if ($MadelineProto === false) { } if ($authorization['_'] === 'account.needSignup') { \danog\MadelineProto\Logger::log(['Registering new user'], \danog\MadelineProto\Logger::NOTICE); - $authorization = $MadelineProto->complete_signup($code, readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); + $authorization = $MadelineProto->complete_signup(readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); } + echo 'Serializing MadelineProto to session.madeline...'.PHP_EOL; echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto).' bytes'.PHP_EOL; } else { $MadelineProto->bot_login(getenv('BOT_TOKEN')); } + } $message = (getenv('TRAVIS_COMMIT') == '') ? 'I iz works always (io laborare sembre) (yo lavorar siempre) (mi labori ĉiam) (я всегда работать) (Ik werkuh altijd)' : ('Travis ci tests in progress: commit '.getenv('TRAVIS_COMMIT').', job '.getenv('TRAVIS_JOB_NUMBER').', PHP version: '.getenv('TRAVIS_PHP_VERSION')); echo 'Serializing MadelineProto to session.madeline...'.PHP_EOL; echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto).' bytes'.PHP_EOL; echo 'Size of MadelineProto instance is '.strlen(serialize($MadelineProto)).' bytes'.PHP_EOL; +if (stripos(readline('Do you want to make the secret chat tests? (y/n)'), 'y') !== false) { + + +/* $call = $MadelineProto->API->request_call(getenv('TEST_SECRET_CHAT')); echo 'Waiting for '.getenv('TEST_SECRET_CHAT').' to accept the call...'.PHP_EOL; @@ -77,23 +83,58 @@ while ($MadelineProto->call_status($call) !== $MadelineProto->API->READY) { $MadelineProto->get_updates(); } var_dump($MadelineProto->get_call($call)); - +*/ $secret = $MadelineProto->API->request_secret_chat(getenv('TEST_SECRET_CHAT')); echo 'Waiting for '.getenv('TEST_SECRET_CHAT').' to accept the secret chat...'.PHP_EOL; while ($MadelineProto->secret_chat_status($secret) !== 2) { $MadelineProto->get_updates(); } -$mention = $MadelineProto->get_info(getenv('TEST_USERNAME')); // Returns an array with all of the constructors that can be extracted from a username or an id -$mention = $mention['user_id']; // Selects only the numeric user id - $MadelineProto->get_updates(); $InputEncryptedChat = $MadelineProto->get_secret_chat($secret)['InputEncryptedChat']; $sentMessage = $MadelineProto->messages->sendEncrypted(['peer' => $InputEncryptedChat, 'message' => ['_' => 'decryptedMessage', 'media' => ['_' => 'decryptedMessageMediaEmpty'], 'ttl' => 10, 'message' => $message, 'entities' => [['_' => 'messageEntityCode', 'offset' => 0, 'length' => mb_strlen($message)]]]]); // should work with all layers \danog\MadelineProto\Logger::log([$sentMessage], \danog\MadelineProto\Logger::NOTICE); +$secret_media = []; + +// Photo uploaded as document, secret chat +$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/faust.jpg', 'fausticorn.jpg'); // This gets an inputFile object with file name magic +$secret_media['document_photo'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/faust.jpg'), 'caption' => 'This file was uploaded using MadelineProto', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'faust.jpg', 'size' => filesize('tests/faust.jpg'), 'attributes' => [['_' => 'documentAttributeImageSize', 'w' => 1280, 'h' => 914]]]]]; + +// Photo, secret chat +$secret_media['photo'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaPhoto', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'caption' => 'This file was uploaded using MadelineProto', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'size' => filesize('tests/faust.jpg'), 'w' => 1280, 'h' => 914]]]; +// GIF, secret chat +$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/pony.mp4'); +$secret_media['gif'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/pony.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/pony.mp4'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'pony.mp4', 'size' => filesize('tests/faust.jpg'), 'attributes' => [['_' => 'documentAttributeAnimated']]]]]; + +// Sticker, secret chat +$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/lel.webp'); +$secret_media['sticker'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/lel.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/lel.webp'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'lel.webp', 'size' => filesize('tests/lel.webp'), 'attributes' => [['_' => 'documentAttributeSticker', 'alt' => 'LEL', 'stickerset' => ['_' => 'inputStickerSetEmpty']]]]]]; + + +// Document, secrey chat +$time = time(); +$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/60', 'magic'); // This gets an inputFile object with file name magic +var_dump(time() - $time); +$secret_media['document'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => 'magic/magic', 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'magic.magic', 'size' => filesize('tests/60'), 'attributes' => [['_' => 'documentAttributeFilename', 'file_name' => 'fairy']]]]]; + + +// Video, secret chat +$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/swing.mp4'); +$secret_media['video'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/swing.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/swing.mp4'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'swing.mp4', 'size' => filesize('tests/swing.mp4'), 'attributes' => [['_' => 'documentAttributeVideo', 'duration' => 5, 'w' => 1280, 'h' => 720]]]]]; + +// audio, secret chat +$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/mosconi.mp3'); +$secret_media['audio'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/mosconi.mp3'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'mosconi.mp3', 'size' => filesize('tests/mosconi.mp3'), 'attributes' => [['_' => 'documentAttributeAudio', 'voice' => false, 'duration' => 1, 'title' => 'AH NON LO SO IO', 'performer' => 'IL DIO GERMANO MOSCONI']]]]]; + +$secret_media['voice'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/mosconi.mp3'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'mosconi.mp3', 'size' => filesize('tests/mosconi.mp3'), 'attributes' => [['_' => 'documentAttributeAudio', 'voice' => true, 'duration' => 1, 'title' => 'AH NON LO SO IO', 'performer' => 'IL DIO GERMANO MOSCONI']]]]]; +foreach ($secret_media as $type => $smessage) { + $type = $MadelineProto->messages->sendEncryptedFile($smessage); +} +} +$mention = $MadelineProto->get_info(getenv('TEST_USERNAME')); // Returns an array with all of the constructors that can be extracted from a username or an id +$mention = $mention['user_id']; // Selects only the numeric user id $media = []; -$secret_media = []; // Photo uploaded as document $inputFile = $MadelineProto->upload('tests/faust.jpg', 'fausticorn.jpg'); // This gets an inputFile object with file name magic @@ -102,48 +143,29 @@ $media['document_photo'] = ['_' => 'inputMediaUploadedDocument', 'file' => $inpu // Photo $media['photo'] = ['_' => 'inputMediaUploadedPhoto', 'file' => $inputFile, 'mime_type' => mime_content_type('tests/faust.jpg'), 'caption' => 'This photo was uploaded using MadelineProto']; -// Photo uploaded as document, secret chat -$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/faust.jpg', 'fausticorn.jpg'); // This gets an inputFile object with file name magic -$secret_media['document_photo'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/faust.jpg'), 'caption' => 'This file was uploaded using MadelineProto', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'faust.jpg', 'size' => filesize('tests/faust.jpg'), 'attributes' => [['_' => 'documentAttributeImageSize', 'w' => 1280, 'h' => 914]]]]]; - -// Photo, secret chat -$secret_media['photo'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaPhoto', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'caption' => 'This file was uploaded using MadelineProto', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'size' => filesize('tests/faust.jpg'), 'w' => 1280, 'h' => 914]]]; - // GIF $inputFile = $MadelineProto->upload('tests/pony.mp4'); $media['gif'] = ['_' => 'inputMediaUploadedDocument', 'file' => $inputFile, 'mime_type' => mime_content_type('tests/pony.mp4'), 'caption' => 'test', 'attributes' => [['_' => 'documentAttributeAnimated']]]; -// GIF, secret chat -$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/pony.mp4'); -$secret_media['gif'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/pony.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/pony.mp4'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'pony.mp4', 'size' => filesize('tests/faust.jpg'), 'attributes' => [['_' => 'documentAttributeAnimated']]]]]; - // Sticker $inputFile = $MadelineProto->upload('tests/lel.webp'); $media['sticker'] = ['_' => 'inputMediaUploadedDocument', 'file' => $inputFile, 'mime_type' => mime_content_type('tests/lel.webp'), 'caption' => 'test', 'attributes' => [['_' => 'documentAttributeSticker', 'alt' => 'LEL', 'stickerset' => ['_' => 'inputStickerSetEmpty']]]]; -// Sticker, secret chat -$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/lel.webp'); -$secret_media['sticker'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/lel.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/lel.webp'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'lel.webp', 'size' => filesize('tests/lel.webp'), 'attributes' => [['_' => 'documentAttributeSticker', 'alt' => 'LEL', 'stickerset' => ['_' => 'inputStickerSetEmpty']]]]]]; // Video $inputFile = $MadelineProto->upload('tests/swing.mp4'); $media['video'] = ['_' => 'inputMediaUploadedDocument', 'file' => $inputFile, 'mime_type' => mime_content_type('tests/swing.mp4'), 'caption' => 'test', 'attributes' => [['_' => 'documentAttributeVideo', 'duration' => 5, 'w' => 1280, 'h' => 720]]]; -// Video, secret chat -$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/swing.mp4'); -$secret_media['video'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/swing.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/swing.mp4'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'swing.mp4', 'size' => filesize('tests/swing.mp4'), 'attributes' => [['_' => 'documentAttributeVideo', 'duration' => 5, 'w' => 1280, 'h' => 720]]]]]; // audio $inputFile = $MadelineProto->upload('tests/mosconi.mp3'); $media['audio'] = ['_' => 'inputMediaUploadedDocument', 'file' => $inputFile, 'mime_type' => mime_content_type('tests/mosconi.mp3'), 'caption' => 'test', 'attributes' => [['_' => 'documentAttributeAudio', 'voice' => false, 'duration' => 1, 'title' => 'AH NON LO SO IO', 'performer' => 'IL DIO GERMANO MOSCONI']]]; -// audio, secret chat -$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/mosconi.mp3'); -$secret_media['audio'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/mosconi.mp3'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'mosconi.mp3', 'size' => filesize('tests/mosconi.mp3'), 'attributes' => [['_' => 'documentAttributeAudio', 'voice' => false, 'duration' => 1, 'title' => 'AH NON LO SO IO', 'performer' => 'IL DIO GERMANO MOSCONI']]]]]; + // voice $media['voice'] = ['_' => 'inputMediaUploadedDocument', 'file' => $inputFile, 'mime_type' => mime_content_type('tests/mosconi.mp3'), 'caption' => 'test', 'attributes' => [['_' => 'documentAttributeAudio', 'voice' => true, 'duration' => 1, 'title' => 'AH NON LO SO IO', 'performer' => 'IL DIO GERMANO MOSCONI']]]; -$secret_media['voice'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/mosconi.mp3'), 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'mosconi.mp3', 'size' => filesize('tests/mosconi.mp3'), 'attributes' => [['_' => 'documentAttributeAudio', 'voice' => true, 'duration' => 1, 'title' => 'AH NON LO SO IO', 'performer' => 'IL DIO GERMANO MOSCONI']]]]]; + // Document $time = time(); @@ -151,15 +173,6 @@ $inputFile = $MadelineProto->upload('tests/60', 'magic'); // This gets an inputF var_dump(time() - $time); $media['document'] = ['_' => 'inputMediaUploadedDocument', 'file' => $inputFile, 'mime_type' => 'magic/magic', 'caption' => 'This file was uploaded using MadelineProto', 'attributes' => [['_' => 'documentAttributeFilename', 'file_name' => 'magic.magic']]]; -// Document, secrey chat -$time = time(); -$inputEncryptedFile = $MadelineProto->upload_encrypted('tests/60', 'magic'); // This gets an inputFile object with file name magic -var_dump(time() - $time); -$secret_media['document'] = ['peer' => $secret, 'file' => $inputEncryptedFile, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => 'magic/magic', 'caption' => 'test', 'key' => $inputEncryptedFile['key'], 'iv' => $inputEncryptedFile['iv'], 'file_name' => 'magic.magic', 'size' => filesize('tests/60'), 'attributes' => [['_' => 'documentAttributeFilename', 'file_name' => 'fairy']]]]]; - -foreach ($secret_media as $type => $smessage) { - $type = $MadelineProto->messages->sendEncryptedFile($smessage); -} foreach (json_decode(getenv('TEST_DESTINATION_GROUPS'), true) as $peer) { $sentMessage = $MadelineProto->messages->sendMessage(['peer' => $peer, 'message' => $message, 'entities' => [['_' => 'inputMessageEntityMentionName', 'offset' => 0, 'length' => mb_strlen($message), 'user_id' => $mention]]]); \danog\MadelineProto\Logger::log([$sentMessage], \danog\MadelineProto\Logger::NOTICE); @@ -169,9 +182,7 @@ foreach (json_decode(getenv('TEST_DESTINATION_GROUPS'), true) as $peer) { } } -sleep(5); var_dump($MadelineProto->API->get_updates()); - echo 'Serializing MadelineProto to session.madeline...'.PHP_EOL; echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('session.madeline', $MadelineProto).' bytes'.PHP_EOL; echo 'Size of MadelineProto instance is '.strlen(serialize($MadelineProto)).' bytes'.PHP_EOL; @@ -189,5 +200,6 @@ foreach (json_decode(getenv('TEST_DESTINATION_GROUPS'), true) as $peer) { $sentMessage = $MadelineProto->messages->sendMessage(['peer' => $peer, 'message' => $message, 'entities' => [['_' => 'inputMessageEntityMentionName', 'offset' => 0, 'length' => mb_strlen($message), 'user_id' => $mention]]]); \danog\MadelineProto\Logger::log([$sentMessage], \danog\MadelineProto\Logger::NOTICE); } -sleep(5); var_dump($MadelineProto->API->get_updates()); +var_dump("HERE"); +