From e39ce1179827569f6c23c4b88c4689d023ff03d2 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 20 Mar 2018 15:02:36 +0000 Subject: [PATCH] Fix docs --- docs/docs/CALLS.md | 3 +++ docs/docs/CHAT_INFO.md | 3 +++ docs/docs/CREATING_A_CLIENT.md | 3 +++ docs/docs/DIALOGS.md | 3 +++ docs/docs/EXCEPTIONS.md | 3 +++ docs/docs/FEATURES.md | 3 +++ docs/docs/FILES.md | 3 +++ docs/docs/FLOOD_WAIT.md | 3 +++ docs/docs/INLINE_BUTTONS.md | 3 +++ docs/docs/INSTALLATION.md | 3 +++ docs/docs/LOGGING.md | 3 +++ docs/docs/LOGIN.md | 3 +++ docs/docs/LUA.md | 3 +++ docs/docs/PROXY.md | 3 +++ docs/docs/REQUIREMENTS.md | 3 +++ docs/docs/SECRET_CHATS.md | 3 +++ docs/docs/SELF.md | 3 +++ docs/docs/SETTINGS.md | 3 +++ docs/docs/UPDATES.md | 3 +++ docs/docs/USING_METHODS.md | 3 +++ 20 files changed, 60 insertions(+) diff --git a/docs/docs/CALLS.md b/docs/docs/CALLS.md index e5e3eda4..9200c6c6 100644 --- a/docs/docs/CALLS.md +++ b/docs/docs/CALLS.md @@ -113,4 +113,7 @@ foreach ($updates as $update) { + + + \ No newline at end of file diff --git a/docs/docs/CHAT_INFO.md b/docs/docs/CHAT_INFO.md index c467ca7c..ad2e3c08 100644 --- a/docs/docs/CHAT_INFO.md +++ b/docs/docs/CHAT_INFO.md @@ -39,5 +39,8 @@ $chat = $MadelineProto->get_info(-10028941842); You can also use `get_info` to get chat info, see [here for the parameters and the result](https://docs.madelineproto.xyz/get_info.html) * Completeness: small +* Speed: very fast +* Caching: full + \ No newline at end of file diff --git a/docs/docs/CREATING_A_CLIENT.md b/docs/docs/CREATING_A_CLIENT.md index 8a4bcae1..a5141eae 100644 --- a/docs/docs/CREATING_A_CLIENT.md +++ b/docs/docs/CREATING_A_CLIENT.md @@ -17,5 +17,8 @@ $MadelineProto = new \danog\MadelineProto\API('session.madeline', $settings); / To change the session file after starting MadelineProto, do the following: ```php +$MadelineProto->session = 'newsession.madeline'; +``` + \ No newline at end of file diff --git a/docs/docs/DIALOGS.md b/docs/docs/DIALOGS.md index 759efc77..6dade6c8 100644 --- a/docs/docs/DIALOGS.md +++ b/docs/docs/DIALOGS.md @@ -26,5 +26,8 @@ foreach ($MadelineProto->API->chats as $bot_api_id => $chat) { } ``` +Since bots cannot run `get_dialogs`, you must make use of the internal MadelineProto database to get a list of all users, chats and channels MadelineProto has seen. +`$MadelineProto->API->chats` contains a list of [Chat](../API_docs/types/Chat.md) and [User](../API_docs/types/User.md) objects, indexed by bot API id. + \ No newline at end of file diff --git a/docs/docs/EXCEPTIONS.md b/docs/docs/EXCEPTIONS.md index d8adde9b..0e2f1f6b 100644 --- a/docs/docs/EXCEPTIONS.md +++ b/docs/docs/EXCEPTIONS.md @@ -99,5 +99,8 @@ try { $estring2 = 'This also works: '.$e; $estring3 = "So does this: $e"; // use $estring to report the error using sendMessage or log +} +``` + \ No newline at end of file diff --git a/docs/docs/FEATURES.md b/docs/docs/FEATURES.md index 8447e1da..21f1d858 100644 --- a/docs/docs/FEATURES.md +++ b/docs/docs/FEATURES.md @@ -40,4 +40,7 @@ * [Clickable inline buttons](#inline-buttons)! + + + \ No newline at end of file diff --git a/docs/docs/FILES.md b/docs/docs/FILES.md index e460a9c6..ff2a977d 100644 --- a/docs/docs/FILES.md +++ b/docs/docs/FILES.md @@ -423,5 +423,8 @@ $sentMessage = $MadelineProto->messages->sendMedia([ $output_file_name = $MadelineProto->download_to_file( new MyCallback($sentMessage, $peer, $MadelineProto), '/tmp/myname.mp4' +); +``` + \ No newline at end of file diff --git a/docs/docs/FLOOD_WAIT.md b/docs/docs/FLOOD_WAIT.md index 2a8b6d7a..182993af 100644 --- a/docs/docs/FLOOD_WAIT.md +++ b/docs/docs/FLOOD_WAIT.md @@ -9,4 +9,7 @@ Calculate it by making N of method calls until you get a FLOOD_WAIT_X floodwaitrate = time it took you to make the method calls + X ``` +Use sleep to execute max N calls in `floodwaitrate` seconds, this way you won't get flood waited! + + \ No newline at end of file diff --git a/docs/docs/INLINE_BUTTONS.md b/docs/docs/INLINE_BUTTONS.md index ac2c4edc..ad8a7036 100644 --- a/docs/docs/INLINE_BUTTONS.md +++ b/docs/docs/INLINE_BUTTONS.md @@ -48,5 +48,8 @@ And click them: ```php $button->click(); +``` + + \ No newline at end of file diff --git a/docs/docs/INSTALLATION.md b/docs/docs/INSTALLATION.md index 64654f29..455af430 100644 --- a/docs/docs/INSTALLATION.md +++ b/docs/docs/INSTALLATION.md @@ -119,4 +119,7 @@ cp -a *php tests userbots .env* .. Now open `.env` and edit its values as needed. + + + \ No newline at end of file diff --git a/docs/docs/LOGGING.md b/docs/docs/LOGGING.md index a5935d77..b60851aa 100644 --- a/docs/docs/LOGGING.md +++ b/docs/docs/LOGGING.md @@ -14,4 +14,7 @@ MadelineProto provides a unified class for logging messages to the logging desti * `\danog\MadelineProto\Logger:VERBOSE` - Indicates a verbose info message * `\danog\MadelineProto\Logger:ULTRA_VERBOSE` - Indicates an ultra verbose +By default, `$level` is `\danog\MadelineProto\Logger:NOTICE`. + + \ No newline at end of file diff --git a/docs/docs/LOGIN.md b/docs/docs/LOGIN.md index 53f74e92..809a7283 100644 --- a/docs/docs/LOGIN.md +++ b/docs/docs/LOGIN.md @@ -57,4 +57,7 @@ $MadelineProto->logout(); Use `logout` to logout, see [here for the parameters and the result](https://docs.madelineproto.xyz/logout.html). + + + \ No newline at end of file diff --git a/docs/docs/LUA.md b/docs/docs/LUA.md index 9bb4f458..a2e008a4 100644 --- a/docs/docs/LUA.md +++ b/docs/docs/LUA.md @@ -14,4 +14,7 @@ Passing lua callables to a parameter of a PHP callable will throw an exception d All MadelineProto wrapper methods (for example upload, download, upload_encrypted, get_self, and others) are imported in the Lua environment, as well as all MTProto wrappers (see the API docs for more info). +td-cli wrappers are also present: you can use the tdcli_function in lua and pass mtproto updates to the tdcli_update_callback via PHP, they will be automatically converted to/from td objects. Please note that the object conversion is not complete, feel free to contribute to the conversion module in [`src/danog/MadelineProto/Conversion/TD.php`](https://github.com/danog/MadelineProto/raw/master/src/danog/MadelineProto/TL/Conversion/TD.php). + + \ No newline at end of file diff --git a/docs/docs/PROXY.md b/docs/docs/PROXY.md index 5bcc78bc..5eb79a19 100644 --- a/docs/docs/PROXY.md +++ b/docs/docs/PROXY.md @@ -118,4 +118,7 @@ Works like [socket_getsockname](http://php.net/manual/en/function.socket-getsock `public function getProxyHeaders();` +Can return additional HTTP headers to use when the HTTP protocol is being used. + + \ No newline at end of file diff --git a/docs/docs/REQUIREMENTS.md b/docs/docs/REQUIREMENTS.md index 56fc7533..66a8c36b 100644 --- a/docs/docs/REQUIREMENTS.md +++ b/docs/docs/REQUIREMENTS.md @@ -11,4 +11,7 @@ sudo apt-get update sudo apt-get install php7.2 php7.2-dev php7.2-fpm php7.2-curl php7.2-xml php7.2-zip php7.2-gmp git -y ``` +Next, follow the instructions on voip.madelineproto.xyz and prime.madelineproto.xyz to install libtgvoip and PrimeModule. + + \ No newline at end of file diff --git a/docs/docs/SECRET_CHATS.md b/docs/docs/SECRET_CHATS.md index ccb84c06..1230bab0 100644 --- a/docs/docs/SECRET_CHATS.md +++ b/docs/docs/SECRET_CHATS.md @@ -64,5 +64,8 @@ $secret_chat = $MadelineProto->get_secret_chat($chat); */ ``` +This method gets info about a certain chat. + + \ No newline at end of file diff --git a/docs/docs/SELF.md b/docs/docs/SELF.md index f6603169..41caba8e 100644 --- a/docs/docs/SELF.md +++ b/docs/docs/SELF.md @@ -6,4 +6,7 @@ $me = $MadelineProto->get_self(); \danog\MadelineProto\Logger::log("Hi ".$me['first_name']."!"); ``` +[`get_self`](https://docs.madelineproto.xyz/get_self.html) returns a [User object](API_docs/types/User.md) that contains info about the currently logged in user/bot, or false if the current instance is not logged in. + + \ No newline at end of file diff --git a/docs/docs/SETTINGS.md b/docs/docs/SETTINGS.md index c41ee5c9..8cdebbdd 100644 --- a/docs/docs/SETTINGS.md +++ b/docs/docs/SETTINGS.md @@ -394,5 +394,8 @@ $MadelineProto->settings = [ The settings array can be accessed and modified in the instantiated class by accessing the `settings` attribute of the API class: ```php +$MadelineProto->settings['updates']['handle_updates'] = true; // reenable update fetching +``` + \ No newline at end of file diff --git a/docs/docs/UPDATES.md b/docs/docs/UPDATES.md index 5160edca..617439ec 100644 --- a/docs/docs/UPDATES.md +++ b/docs/docs/UPDATES.md @@ -193,4 +193,7 @@ $MadelineProto->loop(-1); This way, each update will be managed in its own fork. Note that multiprocessing is not the same as multithreading, and should be avoided unless lengthy operations are made in the update handler. + + + \ No newline at end of file diff --git a/docs/docs/USING_METHODS.md b/docs/docs/USING_METHODS.md index 0018c9b0..db192fce 100644 --- a/docs/docs/USING_METHODS.md +++ b/docs/docs/USING_METHODS.md @@ -96,4 +96,7 @@ Method calls may be executed at diferent times server-side: to avoid this, metho $MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => 'lel'], ['queue' => 'queue_name']); ``` +If the queue if the specified queue name does not exist, it will be created. + + \ No newline at end of file