diff --git a/build_docs_index.php b/build_docs_index.php index f3f0486a..9e9cde6d 100644 --- a/build_docs_index.php +++ b/build_docs_index.php @@ -51,9 +51,17 @@ foreach ($files as $file) { ksort($orderedfiles); } ksort($orderedfiles); -foreach ($orderedfiles as $filename) { +foreach ($orderedfiles as $key => $filename) { $lines = explode("\n", file_get_contents($filename)); - if (strpos(end($lines), "Next")) unset($lines[count($lines)-1]); + if (strpos(end($lines), "Next")) { + unset($lines[count($lines)-1]); + unset($lines[count($lines)-2]); + } + if (isset($orderedfiles[$key+1])) { + $nextfile = "https://docs.madelineproto.xyz/docs/".basename($orderedfiles[$key+1], '.md').".html"; + $lines[count($lines)] = "\n"; + } + file_put_contents($filename, implode("\n", $lines)); preg_match('|^# (.*)|', $file = file_get_contents($filename), $matches); $title = $matches[1]; diff --git a/docs/docs/CALLS.md b/docs/docs/CALLS.md index f88657a6..e5e3eda4 100644 --- a/docs/docs/CALLS.md +++ b/docs/docs/CALLS.md @@ -113,4 +113,4 @@ 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 81b9b593..c467ca7c 100644 --- a/docs/docs/CHAT_INFO.md +++ b/docs/docs/CHAT_INFO.md @@ -39,5 +39,5 @@ $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 a46349e3..8a4bcae1 100644 --- a/docs/docs/CREATING_A_CLIENT.md +++ b/docs/docs/CREATING_A_CLIENT.md @@ -17,5 +17,5 @@ $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 a89609a4..759efc77 100644 --- a/docs/docs/DIALOGS.md +++ b/docs/docs/DIALOGS.md @@ -26,5 +26,5 @@ 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 1d0accb6..d8adde9b 100644 --- a/docs/docs/EXCEPTIONS.md +++ b/docs/docs/EXCEPTIONS.md @@ -99,5 +99,5 @@ 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 622b0f67..8447e1da 100644 --- a/docs/docs/FEATURES.md +++ b/docs/docs/FEATURES.md @@ -40,4 +40,4 @@ * [Clickable inline buttons](#inline-buttons)! - + \ No newline at end of file diff --git a/docs/docs/FILES.md b/docs/docs/FILES.md index cae34675..e460a9c6 100644 --- a/docs/docs/FILES.md +++ b/docs/docs/FILES.md @@ -423,5 +423,5 @@ $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 805a575b..2a8b6d7a 100644 --- a/docs/docs/FLOOD_WAIT.md +++ b/docs/docs/FLOOD_WAIT.md @@ -9,4 +9,4 @@ 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 3099d84e..ac2c4edc 100644 --- a/docs/docs/INLINE_BUTTONS.md +++ b/docs/docs/INLINE_BUTTONS.md @@ -48,5 +48,5 @@ 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 8e0d0641..64654f29 100644 --- a/docs/docs/INSTALLATION.md +++ b/docs/docs/INSTALLATION.md @@ -119,4 +119,4 @@ 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 b482cc19..a5935d77 100644 --- a/docs/docs/LOGGING.md +++ b/docs/docs/LOGGING.md @@ -14,4 +14,4 @@ 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 adbd3549..53f74e92 100644 --- a/docs/docs/LOGIN.md +++ b/docs/docs/LOGIN.md @@ -57,4 +57,4 @@ $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 5daddf37..9bb4f458 100644 --- a/docs/docs/LUA.md +++ b/docs/docs/LUA.md @@ -14,4 +14,4 @@ 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 568cef31..5bcc78bc 100644 --- a/docs/docs/PROXY.md +++ b/docs/docs/PROXY.md @@ -118,4 +118,4 @@ 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 1055d53b..56fc7533 100644 --- a/docs/docs/REQUIREMENTS.md +++ b/docs/docs/REQUIREMENTS.md @@ -11,4 +11,4 @@ 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 905e0211..ccb84c06 100644 --- a/docs/docs/SECRET_CHATS.md +++ b/docs/docs/SECRET_CHATS.md @@ -64,5 +64,5 @@ $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 b3fbb9fa..f6603169 100644 --- a/docs/docs/SELF.md +++ b/docs/docs/SELF.md @@ -6,4 +6,4 @@ $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 954e518f..c41ee5c9 100644 --- a/docs/docs/SETTINGS.md +++ b/docs/docs/SETTINGS.md @@ -394,5 +394,5 @@ $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 9bc5d770..5160edca 100644 --- a/docs/docs/UPDATES.md +++ b/docs/docs/UPDATES.md @@ -193,4 +193,4 @@ $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 42b62029..0018c9b0 100644 --- a/docs/docs/USING_METHODS.md +++ b/docs/docs/USING_METHODS.md @@ -96,4 +96,4 @@ 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