From 894c213a874d8ef3ae8ac66ea3daf7fd30fb96b9 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 5 Jan 2020 17:55:38 +0100 Subject: [PATCH] Update docs --- .../methods/account.getPasswordSettings.md | 6 +++--- .../methods/account.updatePasswordSettings.md | 8 ++++---- docs/API_docs/methods/auth.checkPassword.md | 6 +++--- docs/API_docs/methods/index.md | 6 +++--- docs/botLogin.md | 7 ++++--- docs/complete2FALogin.md | 9 +++++---- docs/completePhoneLogin.md | 9 +++++---- docs/completeSignup.md | 9 +++++---- docs/docs/ASYNC.md | 2 +- docs/docs/CALLS.md | 2 +- docs/docs/CHAT_INFO.md | 20 +++++++++---------- docs/docs/DIALOGS.md | 12 +++++------ docs/docs/EXCEPTIONS.md | 2 +- docs/docs/LOGIN.md | 16 +++++++-------- docs/docs/LUA.md | 2 +- docs/docs/SECRET_CHATS.md | 2 +- docs/docs/SELF.md | 2 +- docs/docs/SETTINGS.md | 2 +- docs/getDialogs.md | 7 ++++--- docs/getFullDialogs.md | 7 ++++--- docs/getFullInfo.md | 7 ++++--- docs/getInfo.md | 7 ++++--- docs/getPwrChat.md | 7 ++++--- docs/getSelf.md | 7 ++++--- docs/index.md | 16 +++++++-------- docs/phoneLogin.md | 9 +++++---- docs/requestCall.md | 7 ++++--- docs/requestSecretChat.md | 7 ++++--- docs/update2fa.md | 7 ++++--- 29 files changed, 112 insertions(+), 98 deletions(-) diff --git a/docs/API_docs/methods/account.getPasswordSettings.md b/docs/API_docs/methods/account.getPasswordSettings.md index cbcb455a..9b2dbc63 100644 --- a/docs/API_docs/methods/account.getPasswordSettings.md +++ b/docs/API_docs/methods/account.getPasswordSettings.md @@ -1,6 +1,6 @@ --- title: account.getPasswordSettings -description: You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) +description: You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png redirect_from: /API_docs/methods/account_getPasswordSettings.html --- @@ -8,13 +8,13 @@ redirect_from: /API_docs/methods/account_getPasswordSettings.html [Back to methods index](index.md) -You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) +You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) ### Parameters: | Name | Type | Description | Required | |----------|---------------|-------------|----------| -|password|[InputCheckPasswordSRP](../types/InputCheckPasswordSRP.md) | You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) | Yes| +|password|[InputCheckPasswordSRP](../types/InputCheckPasswordSRP.md) | You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) | Yes| ### Return type: [account.PasswordSettings](../types/account.PasswordSettings.md) diff --git a/docs/API_docs/methods/account.updatePasswordSettings.md b/docs/API_docs/methods/account.updatePasswordSettings.md index 7b40b9c8..c7cd20f0 100644 --- a/docs/API_docs/methods/account.updatePasswordSettings.md +++ b/docs/API_docs/methods/account.updatePasswordSettings.md @@ -1,6 +1,6 @@ --- title: account.updatePasswordSettings -description: You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) +description: You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png redirect_from: /API_docs/methods/account_updatePasswordSettings.html --- @@ -8,14 +8,14 @@ redirect_from: /API_docs/methods/account_updatePasswordSettings.html [Back to methods index](index.md) -You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) +You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) ### Parameters: | Name | Type | Description | Required | |----------|---------------|-------------|----------| -|password|[InputCheckPasswordSRP](../types/InputCheckPasswordSRP.md) | You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) | Yes| -|new\_settings|[account.PasswordInputSettings](../types/account.PasswordInputSettings.md) | You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info) | Yes| +|password|[InputCheckPasswordSRP](../types/InputCheckPasswordSRP.md) | You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) | Yes| +|new\_settings|[account.PasswordInputSettings](../types/account.PasswordInputSettings.md) | You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) | Yes| ### Return type: [Bool](../types/Bool.md) diff --git a/docs/API_docs/methods/auth.checkPassword.md b/docs/API_docs/methods/auth.checkPassword.md index 98e66855..87639221 100644 --- a/docs/API_docs/methods/auth.checkPassword.md +++ b/docs/API_docs/methods/auth.checkPassword.md @@ -1,6 +1,6 @@ --- title: auth.checkPassword -description: You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info) +description: You cannot use this method directly, use the complete2falogin method instead (see https://docs.madelineproto.xyz for more info) image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png redirect_from: /API_docs/methods/auth_checkPassword.html --- @@ -8,13 +8,13 @@ redirect_from: /API_docs/methods/auth_checkPassword.html [Back to methods index](index.md) -You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info) +You cannot use this method directly, use the complete2falogin method instead (see https://docs.madelineproto.xyz for more info) ### Parameters: | Name | Type | Description | Required | |----------|---------------|-------------|----------| -|password|[InputCheckPasswordSRP](../types/InputCheckPasswordSRP.md) | You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info) | Yes| +|password|[InputCheckPasswordSRP](../types/InputCheckPasswordSRP.md) | You cannot use this method directly, use the complete2falogin method instead (see https://docs.madelineproto.xyz for more info) | Yes| ### Return type: [auth.Authorization](../types/auth.Authorization.md) diff --git a/docs/API_docs/methods/index.md b/docs/API_docs/methods/index.md index aabf94f7..f4d6d37f 100644 --- a/docs/API_docs/methods/index.md +++ b/docs/API_docs/methods/index.md @@ -632,7 +632,7 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png * You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info): auth.signUp -* You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info): auth.checkPassword +* You cannot use this method directly, use the complete2falogin method instead (see https://docs.madelineproto.xyz for more info): auth.checkPassword * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info): channels.getFullChannel @@ -662,7 +662,7 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png * You cannot use this method directly: messages.receivedQueue -* You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.getPasswordSettings +* You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.getPasswordSettings -* You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.updatePasswordSettings +* You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.updatePasswordSettings diff --git a/docs/botLogin.md b/docs/botLogin.md index 6a7c0870..6ec6d75e 100644 --- a/docs/botLogin.md +++ b/docs/botLogin.md @@ -1,8 +1,9 @@ --- -title: bot_login -description: bot_login parameters, return type and example +title: botLogin +description: botLogin parameters, return type and example +redirect_from: /bot_login.html --- -## Method: bot_login +## Method: botLogin ### Parameters: diff --git a/docs/complete2FALogin.md b/docs/complete2FALogin.md index f4ff97f6..d464f639 100644 --- a/docs/complete2FALogin.md +++ b/docs/complete2FALogin.md @@ -1,8 +1,9 @@ --- -title: complete_2FA_login -description: complete_2FA_login parameters, return type and example +title: complete2falogin +description: complete2falogin parameters, return type and example +redirect_from: /complete_2fa_login.html --- -## Method: complete_2FA_login +## Method: complete2falogin ### Parameters: @@ -23,7 +24,7 @@ if ($authorization['_'] === 'account.noPassword') { throw new \danog\MadelineProto\Exception('2FA is enabled but no password is set!'); } if ($authorization['_'] === 'account.password') { - $authorization = yield $MadelineProto->complete_2fa_login(readline('Please enter your password (hint '.$authorization['hint'].'): ')); + $authorization = yield $MadelineProto->complete2falogin(readline('Please enter your password (hint '.$authorization['hint'].'): ')); } if ($authorization['_'] === 'account.needSignup') { $authorization = yield $MadelineProto->completeSignup(readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); diff --git a/docs/completePhoneLogin.md b/docs/completePhoneLogin.md index 44701911..9eb4110c 100644 --- a/docs/completePhoneLogin.md +++ b/docs/completePhoneLogin.md @@ -1,6 +1,7 @@ --- -title: complete_phone_login -description: complete_phone_login parameters, return type and example +title: completePhoneLogin +description: completePhoneLogin parameters, return type and example +redirect_from: /complete_phone_login.html --- ## Method: complete\_phone\_login @@ -13,7 +14,7 @@ description: complete_phone_login parameters, return type and example ### Return type: [auth.Authorization](API_docs/types/auth_Authorization.md) or [account.Password](http://docs.madelineproto.xyz/API_docs/types/account_Password.html) or `['_' => 'account.needSignup']` -You must then use [complete_2FA_login](complete_2FA_login.md) or [completeSignup](completeSignup.md) to login or signup, or simply start using `$MadelineProto` if the result is a `auth.Authorization` object. +You must then use [complete2falogin](complete2FALogin.md) or [completeSignup](completeSignup.md) to login or signup, or simply start using `$MadelineProto` if the result is a `auth.Authorization` object. ### Example ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)): @@ -25,7 +26,7 @@ if ($authorization['_'] === 'account.noPassword') { throw new \danog\MadelineProto\Exception('2FA is enabled but no password is set!'); } if ($authorization['_'] === 'account.password') { - $authorization = yield $MadelineProto->complete_2fa_login(readline('Please enter your password (hint '.$authorization['hint'].'): ')); + $authorization = yield $MadelineProto->complete2falogin(readline('Please enter your password (hint '.$authorization['hint'].'): ')); } if ($authorization['_'] === 'account.needSignup') { $authorization = yield $MadelineProto->completeSignup(readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); diff --git a/docs/completeSignup.md b/docs/completeSignup.md index 727e63ff..804bc9b2 100644 --- a/docs/completeSignup.md +++ b/docs/completeSignup.md @@ -1,8 +1,9 @@ --- -title: complete_signup -description: complete_signup parameters, return type and example +title: completeSignup +description: completeSignup parameters, return type and example +redirect_from: /complete_signup.html --- -## Method: complete_signup +## Method: completeSignup ### Parameters: @@ -24,7 +25,7 @@ if ($authorization['_'] === 'account.noPassword') { throw new \danog\MadelineProto\Exception('2FA is enabled but no password is set!'); } if ($authorization['_'] === 'account.password') { - $authorization = yield $MadelineProto->complete_2fa_login(readline('Please enter your password (hint '.$authorization['hint'].'): ')); + $authorization = yield $MadelineProto->complete2falogin(readline('Please enter your password (hint '.$authorization['hint'].'): ')); } if ($authorization['_'] === 'account.needSignup') { $authorization = yield $MadelineProto->completeSignup(readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); diff --git a/docs/docs/ASYNC.md b/docs/docs/ASYNC.md index 846c366f..230f6d83 100644 --- a/docs/docs/ASYNC.md +++ b/docs/docs/ASYNC.md @@ -94,7 +94,7 @@ $result = $sm('@danogentili', 'hi'); ``` This **will not work**, because the result of a function that uses `yield` is not the `return`ed value, but a [generator](https://www.php.net/manual/en/language.generators.overview.php), which is what the async AMPHP API is based on. -If the generator is not __passed to the AMPHP event loop__, execution of the function will not be resumed: when MadelineProto asynchronously obtains the result of the get_info, execution of the function is never resumed, and the line with sendMessage is never called. +If the generator is not __passed to the AMPHP event loop__, execution of the function will not be resumed: when MadelineProto asynchronously obtains the result of the getInfo, execution of the function is never resumed, and the line with sendMessage is never called. To avoid this problem, only call asynchronous functions in the event/callback update handler, or in functions called by the event/callback update handler, or inside a function passed to loop. You can also call asynchronous functions created by you, within other asynchronous functions. Generators in MadelineProto are equivalent to promises, which is a paradigm you may have used in other languages. diff --git a/docs/docs/CALLS.md b/docs/docs/CALLS.md index 87e4e344..48b6de75 100644 --- a/docs/docs/CALLS.md +++ b/docs/docs/CALLS.md @@ -90,7 +90,7 @@ If you manually set the network type to `NET_TYPE_GPRS`, `NET_TYPE_EDGE`, or ena ## Putting it all together -Requesting calls is easy, just run the `request_call` method. +Requesting calls is easy, just run the `requestCall` method. ```php $controller = $MadelineProto->requestCall('@danogentili')->play('input.raw')->then('inputb.raw')->playOnHold(['hold.raw'])->setOutputFile('output.raw'); diff --git a/docs/docs/CHAT_INFO.md b/docs/docs/CHAT_INFO.md index e8dfa2be..d784f3e5 100644 --- a/docs/docs/CHAT_INFO.md +++ b/docs/docs/CHAT_INFO.md @@ -7,12 +7,12 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png There are various methods that can be used to fetch info about chats, based on bot API id, tg-cli ID, Peer, User, Chat objects. -* [Full chat info with full list of participants](#get_pwr_chat-now-fully-async) -* [Full chat info](#get_full_info-now-fully-async) -* [Reduced chat info (very fast)](#get_info-now-fully-async) +* [Full chat info with full list of participants](#getPwrChat-now-fully-async) +* [Full chat info](#getFullInfo-now-fully-async) +* [Reduced chat info (very fast)](#getInfo-now-fully-async) * [Just the chat ID (extremely fast)](#get_id-now-fully-async) -## get_pwr_chat ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) +## getPwrChat ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) ```php $pwr_chat = yield $MadelineProto->getPwrChat(-100214891824); foreach ($pwr_chat['participants'] as $participant) { @@ -20,29 +20,29 @@ foreach ($pwr_chat['participants'] as $participant) { } ``` -Use `get_pwr_chat` to get full chat info, including the full list of members, see [here for the parameters and the result](https://docs.madelineproto.xyz/getPwrChat.html). +Use `getPwrChat` to get full chat info, including the full list of members, see [here for the parameters and the result](https://docs.madelineproto.xyz/getPwrChat.html). * Completeness: full * Speed: medium * Caching: medium -## get_full_info ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) +## getFullInfo ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) ```php $full_chat = yield $MadelineProto->getFullInfo(-10028941842); ``` -You can also use `get_full_info` to get full chat info, without the full list of members, see [here for the parameters and the result](https://docs.madelineproto.xyz/getFullInfo.html). +You can also use `getFullInfo` to get full chat info, without the full list of members, see [here for the parameters and the result](https://docs.madelineproto.xyz/getFullInfo.html). * Completeness: medium * Speed: medium-fast * Caching: full -## get_info ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) +## getInfo ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) ```php $chat = yield $MadelineProto->getInfo(-10028941842); ``` -You can also use `get_info` to get chat info, see [here for the parameters and the result](https://docs.madelineproto.xyz/getInfo.html) +You can also use `getInfo` to get chat info, see [here for the parameters and the result](https://docs.madelineproto.xyz/getInfo.html) * Completeness: small * Speed: very fast @@ -58,4 +58,4 @@ You can also use `get_id` to get chat ID from updates, messages and other object * Speed: very fast * Caching: full -Next section \ No newline at end of file +Next section diff --git a/docs/docs/DIALOGS.md b/docs/docs/DIALOGS.md index c4968977..466e7a72 100644 --- a/docs/docs/DIALOGS.md +++ b/docs/docs/DIALOGS.md @@ -7,10 +7,10 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png There are two ways to get a list of all chats, depending if you logged in as a user, or as a bot. -* [Dialog list](#get_dialogs-now-fully-async) -* [Full dialog info](#get_full_dialogs-now-fully-async) +* [Dialog list](#getDialogs-now-fully-async) +* [Full dialog info](#getFullDialogs-now-fully-async) -## get_dialogs ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) +## getDialogs ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) ```php $dialogs = yield $MadelineProto->getDialogs(); foreach ($dialogs as $peer) { @@ -18,9 +18,9 @@ foreach ($dialogs as $peer) { } ``` -`get_dialogs` will return a full list of all chats you're member of, see [here for the parameters and the result](https://docs.madelineproto.xyz/getDialogs.html) +`getDialogs` will return a full list of all chats you're member of, see [here for the parameters and the result](https://docs.madelineproto.xyz/getDialogs.html) -## get_full_dialogs ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) +## getFullDialogs ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) ```php $dialogs = yield $MadelineProto->getFullDialogs(); foreach ($dialogs as $dialog) { @@ -28,6 +28,6 @@ foreach ($dialogs as $dialog) { } ``` -`get_full_dialogs` will return a full list of all chats you're member of, including dialog info (such as the pinned/last message ID, unread count, tag count, notification settings and message drafts) see [here for the parameters and the result](https://docs.madelineproto.xyz/getFullDialogs.html) +`getFullDialogs` will return a full list of all chats you're member of, including dialog info (such as the pinned/last message ID, unread count, tag count, notification settings and message drafts) see [here for the parameters and the result](https://docs.madelineproto.xyz/getFullDialogs.html) Next section \ No newline at end of file diff --git a/docs/docs/EXCEPTIONS.md b/docs/docs/EXCEPTIONS.md index a969d3f8..4e57864b 100644 --- a/docs/docs/EXCEPTIONS.md +++ b/docs/docs/EXCEPTIONS.md @@ -14,7 +14,7 @@ try { if ($e->rpc === 'BOT_METHOD_INVALID') { \danog\MadelineProto\Logger::log("Bots can't execute this method!"); } else { - $MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => 'An error occurred while calling get_dialogs: '.$e]); + $MadelineProto->messages->sendMessage(['peer' => '@danogentili', 'message' => 'An error occurred while calling getDialogs: '.$e]); } } ``` diff --git a/docs/docs/LOGIN.md b/docs/docs/LOGIN.md index 8ec57447..98e1ec9d 100644 --- a/docs/docs/LOGIN.md +++ b/docs/docs/LOGIN.md @@ -92,19 +92,19 @@ After you provide an API ID, you can then login (if you're using the [automatic yield $MadelineProto->phoneLogin(yield $MadelineProto->readline('Enter your phone number: ')); $authorization = yield $MadelineProto->completePhoneLogin(yield $MadelineProto->readline('Enter the phone code: ')); if ($authorization['_'] === 'account.password') { - $authorization = yield $MadelineProto->complete_2fa_login(yield $MadelineProto->readline('Please enter your password (hint '.$authorization['hint'].'): ')); + $authorization = yield $MadelineProto->complete2falogin(yield $MadelineProto->readline('Please enter your password (hint '.$authorization['hint'].'): ')); } if ($authorization['_'] === 'account.needSignup') { $authorization = yield $MadelineProto->completeSignup(yield $MadelineProto->readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); } ``` -First, you must call `phone_login` to send the verification code, see [here for the parameters and the result](https://docs.madelineproto.xyz/phoneLogin.html). -Then, use `complete_phone_login` to complete the login, see [here for the parameters and the result](https://docs.madelineproto.xyz/completePhoneLogin.html). +First, you must call `phoneLogin` to send the verification code, see [here for the parameters and the result](https://docs.madelineproto.xyz/phoneLogin.html). +Then, use `completePhoneLogin` to complete the login, see [here for the parameters and the result](https://docs.madelineproto.xyz/completePhoneLogin.html). -Use `complete_2FA_login` to complete the login to an account with 2FA enabled, see [here for the parameters and the result](https://docs.madelineproto.xyz/complete_2FA_login.html). +Use `complete2falogin` to complete the login to an account with 2FA enabled, see [here for the parameters and the result](https://docs.madelineproto.xyz/complete2falogin.html). -If the account does not have an account, use `complete_signup` to signup, see [here for the parameters and the result](https://docs.madelineproto.xyz/completeSignup.html). +If the account does not have an account, use `completeSignup` to signup, see [here for the parameters and the result](https://docs.madelineproto.xyz/completeSignup.html). ## Manual (bot) @@ -113,7 +113,7 @@ If the account does not have an account, use `complete_signup` to signup, see [h yield $MadelineProto->botLogin('34298141894:aflknsaflknLKNFS'); ``` -Use `bot_login` to login as a bot, see [here for the parameters and the result](https://docs.madelineproto.xyz/botLogin.html). +Use `botLogin` to login as a bot, see [here for the parameters and the result](https://docs.madelineproto.xyz/botLogin.html). 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. @@ -129,9 +129,9 @@ If you want to logout, you can use the logout function, see [here for the parame ## Changing 2FA password ```php -$result = yield $MadelineProto->update_2fa(['password' => 'current password', 'new_password' => 'New password', 'email' => 'daniil@daniil.it', 'hint' => 'ponies']); +$result = yield $MadelineProto->update2fa(['password' => 'current password', 'new_password' => 'New password', 'email' => 'daniil@daniil.it', 'hint' => 'ponies']); ``` -If you want to logout, you can use the update_2fa function, see [here for the parameters and the result](https://docs.madelineproto.xyz/update_2fa.html). +If you want to logout, you can use the update2fa function, see [here for the parameters and the result](https://docs.madelineproto.xyz/update2fa.html). Next section \ No newline at end of file diff --git a/docs/docs/LUA.md b/docs/docs/LUA.md index c8561911..b23bc1e7 100644 --- a/docs/docs/LUA.md +++ b/docs/docs/LUA.md @@ -18,7 +18,7 @@ By assigning a callable to an attribute, you're actually assigning a new functio Passing lua callables to a parameter of a PHP callable will throw an exception due to a bug in the PHP lua extension that I gotta fix (so passing the usual cb and cb_extra parameters to the td-cli wrappers isn't yet possible). -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). +All MadelineProto wrapper methods (for example upload, download, upload_encrypted, getSelf, 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). diff --git a/docs/docs/SECRET_CHATS.md b/docs/docs/SECRET_CHATS.md index 78cc56ac..685dc6c8 100644 --- a/docs/docs/SECRET_CHATS.md +++ b/docs/docs/SECRET_CHATS.md @@ -18,7 +18,7 @@ MadelineProto provides wrappers to work with secret chats. $secret_chat = yield $MadelineProto->requestSecretChat($InputUser); ``` -[`request_secret_chat`](https://docs.madelineproto.xyz/requestSecretChat.html) requests a secret secret chat to the [InputUser](https://docs.madelineproto.xyz/API_docs/types/InputUser.html), ID, or username specified, and returns the secret chat ID. +[`requestSecretChat`](https://docs.madelineproto.xyz/requestSecretChat.html) requests a secret secret chat to the [InputUser](https://docs.madelineproto.xyz/API_docs/types/InputUser.html), ID, or username specified, and returns the secret chat ID. ## Accepting secret chats ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) diff --git a/docs/docs/SELF.md b/docs/docs/SELF.md index d9fb19a2..b5a34d23 100644 --- a/docs/docs/SELF.md +++ b/docs/docs/SELF.md @@ -13,6 +13,6 @@ $me = yield $MadelineProto->getSelf(); \danog\MadelineProto\Logger::log("Hi ".$me['first_name']."!"); ``` -[`get_self`](https://docs.madelineproto.xyz/getSelf.html) returns a [User object](../API_docs/types/User.html) that contains info about the currently logged in user/bot, or false if the current instance is not logged in. +[`getSelf`](https://docs.madelineproto.xyz/getSelf.html) returns a [User object](../API_docs/types/User.html) that contains info about the currently logged in user/bot, or false if the current instance is not logged in. Next section \ No newline at end of file diff --git a/docs/docs/SETTINGS.md b/docs/docs/SETTINGS.md index a6a0e4fe..7fb1f476 100644 --- a/docs/docs/SETTINGS.md +++ b/docs/docs/SETTINGS.md @@ -368,7 +368,7 @@ Peer caching settings ### `$settings['peer']['full_info_cache_time']` Default: 3600 -Description: Cache validity of full peer info (obtained with [getFullInfo](CHAT_INFO.html#get_full_info)) +Description: Cache validity of full peer info (obtained with [getFullInfo](CHAT_INFO.html#getFullInfo)) ### `$settings['peer']['full_fetch']` Default: false diff --git a/docs/getDialogs.md b/docs/getDialogs.md index ed12a575..04e961ab 100644 --- a/docs/getDialogs.md +++ b/docs/getDialogs.md @@ -1,8 +1,9 @@ --- -title: get_dialogs -description: get_dialogs parameters, return type and example +title: getDialogs +description: getDialogs parameters, return type and example +redirect_from: /get_dialogs.html --- -## Method: get_dialogs +## Method: getDialogs Gets full list of dialogs diff --git a/docs/getFullDialogs.md b/docs/getFullDialogs.md index 2bbb0015..43193066 100644 --- a/docs/getFullDialogs.md +++ b/docs/getFullDialogs.md @@ -1,8 +1,9 @@ --- -title: get_full_dialogs -description: get_full_dialogs parameters, return type and example +title: getFullDialogs +description: getFullDialogs parameters, return type and example +redirect_from: /get_full_dialogs.html --- -## Method: get_dialogs +## Method: getDialogs Gets full list of dialogs diff --git a/docs/getFullInfo.md b/docs/getFullInfo.md index eb95df85..64386ace 100644 --- a/docs/getFullInfo.md +++ b/docs/getFullInfo.md @@ -1,8 +1,9 @@ --- -title: get_full_info -description: get_full_info parameters, return type and example +title: getFullInfo +description: getFullInfo parameters, return type and example +redirect_from: /get_full_info.html --- -## Method: get_full_info +## Method: getFullInfo ### Parameters: diff --git a/docs/getInfo.md b/docs/getInfo.md index 17e7c02b..75e7cf98 100644 --- a/docs/getInfo.md +++ b/docs/getInfo.md @@ -1,8 +1,9 @@ --- -title: get_info -description: get_info parameters, return type and example +title: getInfo +description: getInfo parameters, return type and example +redirect_from: /get_info.html --- -## Method: get_info +## Method: getInfo ### Parameters: diff --git a/docs/getPwrChat.md b/docs/getPwrChat.md index dc635094..352004b8 100644 --- a/docs/getPwrChat.md +++ b/docs/getPwrChat.md @@ -1,8 +1,9 @@ --- -title: get_pwr_chat -description: get_pwr_chat parameters, return type and example +title: getPwrChat +description: getPwrChat parameters, return type and example +redirect_from: /get_pwr_chat.html --- -## Method: get_pwr_chat +## Method: getPwrChat ### Parameters: diff --git a/docs/getSelf.md b/docs/getSelf.md index b0acf22b..9d8882f2 100644 --- a/docs/getSelf.md +++ b/docs/getSelf.md @@ -1,8 +1,9 @@ --- -title: get_self -description: get_self parameters, return type and example +title: getSelf +description: getSelf parameters, return type and example +redirect_from: /get_self.html --- -## Method: get_self +## Method: getSelf Gets info about the currently logged-in user. diff --git a/docs/index.md b/docs/index.md index db90de21..6157a7ed 100644 --- a/docs/index.md +++ b/docs/index.md @@ -135,13 +135,13 @@ You can find examples for nearly every MadelineProto function in * [Download to browser (streaming)](https://docs.madelineproto.xyz/docs/FILES.html#download-to-browser-with-streams) * [Getting progress](https://docs.madelineproto.xyz/docs/FILES.html#getting-progress) * [Getting info about chats](https://docs.madelineproto.xyz/docs/CHAT_INFO.html) - * [Full chat info with full list of participants](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_pwr_chat-now-fully-async) - * [Full chat info](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_full_info-now-fully-async) - * [Reduced chat info (very fast)](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_info-now-fully-async) + * [Full chat info with full list of participants](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#getPwrChat-now-fully-async) + * [Full chat info](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#getFullInfo-now-fully-async) + * [Reduced chat info (very fast)](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#getInfo-now-fully-async) * [Just the chat ID (extremely fast)](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_id-now-fully-async) * [Getting all chats (dialogs)](https://docs.madelineproto.xyz/docs/DIALOGS.html) - * [Dialog list](https://docs.madelineproto.xyz/docs/DIALOGS.html#get_dialogs-now-fully-async) - * [Full dialog info](https://docs.madelineproto.xyz/docs/DIALOGS.html#get_full_dialogs-now-fully-async) + * [Dialog list](https://docs.madelineproto.xyz/docs/DIALOGS.html#getDialogs-now-fully-async) + * [Full dialog info](https://docs.madelineproto.xyz/docs/DIALOGS.html#getFullDialogs-now-fully-async) * [Inline buttons ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html))](https://docs.madelineproto.xyz/docs/INLINE_BUTTONS.html) * [Secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html) * [Requesting secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#requesting-secret-chats-now-fully-async) @@ -496,7 +496,7 @@ You can find examples for nearly every MadelineProto function in * You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info): auth.importBotAuthorization * You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info): auth.signIn * You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info): auth.signUp - * You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info): auth.checkPassword + * You cannot use this method directly, use the complete2falogin method instead (see https://docs.madelineproto.xyz for more info): auth.checkPassword * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info): channels.getFullChannel * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info): messages.getFullChat * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info): users.getFullUser @@ -511,8 +511,8 @@ You can find examples for nearly every MadelineProto function in * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info: upload.saveBigFilePart * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info: upload.saveFilePart * You cannot use this method directly: messages.receivedQueue - * You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.getPasswordSettings - * You cannot use this method directly; use $MadelineProto->update_2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.updatePasswordSettings + * You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.getPasswordSettings + * You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.updatePasswordSettings * [Peers](https://docs.madelineproto.xyz/docs/USING_METHODS.html#peers) * [Files](https://docs.madelineproto.xyz/docs/FILES.html) * [Secret chats](https://docs.madelineproto.xyz/docs/USING_METHODS.html#secret-chats) diff --git a/docs/phoneLogin.md b/docs/phoneLogin.md index 9c876b19..76d0b03e 100644 --- a/docs/phoneLogin.md +++ b/docs/phoneLogin.md @@ -1,8 +1,9 @@ --- -title: phone_login -description: phone_login parameters, return type and example +title: phoneLogin +description: phoneLogin parameters, return type and example +redirect_from: /phone_login.html --- -## Method: phone_login +## Method: phoneLogin ### Parameters: @@ -26,7 +27,7 @@ if ($authorization['_'] === 'account.noPassword') { throw new \danog\MadelineProto\Exception('2FA is enabled but no password is set!'); } if ($authorization['_'] === 'account.password') { - $authorization = yield $MadelineProto->complete_2fa_login(readline('Please enter your password (hint '.$authorization['hint'].'): ')); + $authorization = yield $MadelineProto->complete2falogin(readline('Please enter your password (hint '.$authorization['hint'].'): ')); } if ($authorization['_'] === 'account.needSignup') { $authorization = yield $MadelineProto->completeSignup(readline('Please enter your first name: '), readline('Please enter your last name (can be empty): ')); diff --git a/docs/requestCall.md b/docs/requestCall.md index a459b3e1..a9ca43d8 100644 --- a/docs/requestCall.md +++ b/docs/requestCall.md @@ -1,8 +1,9 @@ --- -title: request_secret_chat -description: request_secret_chat parameters, return type and example +title: requestCall +description: requestCall parameters, return type and example +redirect_from: /requestCall.html --- -## Method: request_secret_chat +## Method: requestCall ### Parameters: diff --git a/docs/requestSecretChat.md b/docs/requestSecretChat.md index d66eea33..4c0dff98 100644 --- a/docs/requestSecretChat.md +++ b/docs/requestSecretChat.md @@ -1,8 +1,9 @@ --- -title: request_secret_chat -description: request_secret_chat parameters, return type and example +title: requestSecretChat +description: requestSecretChat parameters, return type and example +redirect_from: /request_secret_chat.html --- -## Method: request_secret_chat +## Method: requestSecretChat ### Parameters: diff --git a/docs/update2fa.md b/docs/update2fa.md index d144c514..7ea6a147 100644 --- a/docs/update2fa.md +++ b/docs/update2fa.md @@ -1,8 +1,9 @@ --- -title: update_2fa +title: update2fa description: Update 2FA password +redirect_from: /update_2fa.html --- -## Method: update_2fa +## Method: update2fa The params array can contain password (current password), new_password, email (optional) and hint params. @@ -19,7 +20,7 @@ The params array can contain password (current password), new_password, email (o ```php try { - $MadelineProto->update_2fa(['password' => 'current password', 'new_password' => 'New password', 'email' => 'daniil@daniil.it', 'hint' => 'ponies']); + $MadelineProto->update2fa(['password' => 'current password', 'new_password' => 'New password', 'email' => 'daniil@daniil.it', 'hint' => 'ponies']); } catch (RPCErrorException $e) { if (strpos($e->rpc, 'EMAIL_UNCONFIRMED_') !== false) { $Bool = yield $MadelineProto->account->confirmPasswordEmail(['code' => yield $MadelineProto->readline('Enter your email code: ')]);