From 92717a2d050301a4e81ba7ee87564301b42bc081 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 29 Oct 2019 22:41:31 +0100 Subject: [PATCH] MUUUAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BUUURN SNAKES BUUURN MUAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA cough --- README.md | 20 +- docs | 2 +- examples/bot.php | 2 +- examples/index.php | 2 +- examples/lua/td.php | 12 +- examples/pwrtelegram_debug_bot.php | 16 +- examples/secret_bot.php | 2 +- src/danog/MadelineProto/API.php | 10 +- .../MadelineProto/AnnotationsBuilder.php | 8 +- src/danog/MadelineProto/CombinedAPI.php | 4 +- src/danog/MadelineProto/Connection.php | 10 +- src/danog/MadelineProto/DataCenter.php | 2 +- src/danog/MadelineProto/DocsBuilder.php | 4 +- .../DocsBuilder/Constructors.php | 6 +- .../MadelineProto/DocsBuilder/Methods.php | 46 +-- src/danog/MadelineProto/InternalDoc.php | 122 +++--- src/danog/MadelineProto/Lang.php | 364 +++++++++--------- .../Loop/Connection/HttpWaitLoop.php | 2 +- .../Loop/Connection/ReadLoop.php | 2 +- .../Loop/Connection/WriteLoop.php | 8 +- .../MadelineProto/Loop/Update/FeedLoop.php | 8 +- .../MadelineProto/Loop/Update/SeqLoop.php | 8 +- .../MadelineProto/Loop/Update/UpdateLoop.php | 4 +- src/danog/MadelineProto/Lua.php | 6 +- src/danog/MadelineProto/MTProto.php | 34 +- .../MTProtoSession/CallHandler.php | 4 +- .../MTProtoSession/ResponseHandler.php | 8 +- .../MTProtoSession/SeqNoHandler.php | 8 +- .../MTProtoTools/AuthKeyHandler.php | 2 +- .../MTProtoTools/CallHandler.php | 2 +- .../MadelineProto/MTProtoTools/Files.php | 6 +- .../MTProtoTools/ReferenceDatabase.php | 2 +- .../MTProtoTools/UpdateHandler.php | 24 +- src/danog/MadelineProto/Magic.php | 8 +- src/danog/MadelineProto/RPCErrorException.php | 2 +- src/danog/MadelineProto/Server.php | 6 +- src/danog/MadelineProto/Server/Handler.php | 10 +- src/danog/MadelineProto/Server/Proxy.php | 4 +- src/danog/MadelineProto/TL/Conversion/TD.php | 2 +- .../MadelineProto/TL/PrettyException.php | 2 +- src/danog/MadelineProto/TL/Types/Button.php | 2 +- .../MadelineProto/VoIP/AuthKeyHandler.php | 2 +- src/danog/MadelineProto/Wrappers/ApiStart.php | 2 +- .../MadelineProto/Wrappers/ApiTemplates.php | 2 +- src/danog/MadelineProto/Wrappers/Callback.php | 2 +- src/danog/MadelineProto/Wrappers/Events.php | 4 +- src/danog/MadelineProto/Wrappers/Login.php | 8 +- src/danog/MadelineProto/Wrappers/Loop.php | 6 +- src/danog/MadelineProto/Wrappers/Noop.php | 2 +- src/danog/MadelineProto/Wrappers/TOS.php | 4 +- src/danog/MadelineProto/Wrappers/Webhook.php | 4 +- tests/testing.php | 24 +- tools/layerdiff.php | 2 +- tools/std.php | 34 +- tools/translator.php | 4 +- 55 files changed, 459 insertions(+), 437 deletions(-) diff --git a/README.md b/README.md index de05731b..147418ee 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ $MadelineProto->async(true); $MadelineProto->loop(function () use ($MadelineProto) { yield $MadelineProto->start(); - $me = yield $MadelineProto->get_self(); + $me = yield $MadelineProto->getSelf(); $MadelineProto->logger($me); @@ -168,10 +168,10 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro * [Login](https://docs.madelineproto.xyz/docs/LOGIN.html) * [Change 2FA password](https://docs.madelineproto.xyz/update_2fa.html) * [Get all chats, broadcast a message to all chats](https://docs.madelineproto.xyz/docs/DIALOGS.html) - * [Get the full participant list of a channel/group/supergroup](https://docs.madelineproto.xyz/get_pwr_chat.html) - * [Get full info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/get_full_info.html) - * [Get info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/get_info.html) - * [Get info about the currently logged-in user](https://docs.madelineproto.xyz/get_self.html) + * [Get the full participant list of a channel/group/supergroup](https://docs.madelineproto.xyz/getPwrChat.html) + * [Get full info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/getFullInfo.html) + * [Get info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/getInfo.html) + * [Get info about the currently logged-in user](https://docs.madelineproto.xyz/getSelf.html) * [Upload or download files up to 1.5 GB](https://docs.madelineproto.xyz/docs/FILES.html) * [Make a phone call and play a song](https://docs.madelineproto.xyz/docs/CALLS.html) * [Create a secret chat bot](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html) @@ -276,7 +276,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro * Get blocked users: contacts.getBlocked * Get call configuration: phone.getCallConfig * Get channel/supergroup messages: channels.getMessages - * Get channel/supergroup participants (you should use `$MadelineProto->get_pwr_chat($id)` instead): channels.getParticipants + * Get channel/supergroup participants (you should use `$MadelineProto->getPwrChat($id)` instead): channels.getParticipants * Get chats in common with a user: messages.getCommonChats * Get contacts by IDs: contacts.getContactIDs * Get deep link info: help.getDeepLinkInfo @@ -354,7 +354,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro * Get wallpaper info: account.getWallPaper * Get webpage preview: messages.getWebPage * Get webpage preview: messages.getWebPagePreview - * Gets list of chats: you should use $MadelineProto->get_dialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html: messages.getDialogs + * Gets list of chats: you should use $MadelineProto->getDialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html: messages.getDialogs * Global message search: messages.searchGlobal * Hide peer settings bar: messages.hidePeerSettingsBar * Import chat invite: messages.importChatInvite @@ -463,7 +463,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro * Verify email address: account.verifyEmail * Verify phone number: account.verifyPhone * You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info: auth.bindTempAuthKey - * You cannot use this method directly, instead use $MadelineProto->get_dh_config();: messages.getDhConfig + * You cannot use this method directly, instead use $MadelineProto->getDhConfig();: messages.getDhConfig * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats: messages.acceptEncryption * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats: messages.discardEncryption * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats: messages.requestEncryption @@ -474,8 +474,8 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro * You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls: phone.confirmCall * You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls: phone.discardCall * You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls: phone.requestCall - * You cannot use this method directly, use $MadelineProto->export_authorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html: auth.exportAuthorization - * You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html: auth.importAuthorization + * You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html: auth.exportAuthorization + * You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html: auth.importAuthorization * You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info): auth.importBotAuthorization * 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 complete_phone_login method instead (see https://docs.madelineproto.xyz for more info): auth.signIn diff --git a/docs b/docs index acdcb1ab..9f21080a 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit acdcb1ab5446e148c7476c36b6db9265a47e5bec +Subproject commit 9f21080a2952ff2d62af31aebbebae8743653aa9 diff --git a/examples/bot.php b/examples/bot.php index 7e42acdd..9892dfde 100755 --- a/examples/bot.php +++ b/examples/bot.php @@ -63,7 +63,7 @@ class EventHandler extends \danog\MadelineProto\EventHandler ['_' => 'documentAttributeFilename', 'file_name' => 'document.txt'] ] ],]);*/ - //yield $this->download_to_dir($update, '/tmp'); + //yield $this->downloadToDir($update, '/tmp'); } } catch (\danog\MadelineProto\RPCErrorException $e) { $this->logger((string) $e, \danog\MadelineProto\Logger::FATAL_ERROR); diff --git a/examples/index.php b/examples/index.php index 762011c0..fc28ea00 100644 --- a/examples/index.php +++ b/examples/index.php @@ -23,7 +23,7 @@ require 'vendor/autoload.php'; $MadelineProto = new \danog\MadelineProto\API('session.madeline'); $me = $MadelineProto->start(); -$me = $MadelineProto->get_self(); +$me = $MadelineProto->getSelf(); \danog\MadelineProto\Logger::log($me); diff --git a/examples/lua/td.php b/examples/lua/td.php index 04339d3e..cb0e5992 100755 --- a/examples/lua/td.php +++ b/examples/lua/td.php @@ -26,11 +26,11 @@ if (!\is_object($Lua)) { } switch ($res) { case 'u': - $sentCode = $MadelineProto->phone_login(\readline('Enter your phone number: ')); + $sentCode = $MadelineProto->phoneLogin(\readline('Enter your phone number: ')); \danog\MadelineProto\Logger::log($sentCode, \danog\MadelineProto\Logger::NOTICE); echo 'Enter the code you received: '; $code = \fgets(STDIN, (isset($sentCode['type']['length']) ? $sentCode['type']['length'] : 5) + 1); - $authorization = $MadelineProto->complete_phone_login($code); + $authorization = $MadelineProto->completePhoneLogin($code); \danog\MadelineProto\Logger::log($authorization, \danog\MadelineProto\Logger::NOTICE); if ($authorization['_'] === 'account.noPassword') { throw new \danog\MadelineProto\Exception('2FA is enabled but no password is set!'); @@ -41,13 +41,13 @@ if (!\is_object($Lua)) { } if ($authorization['_'] === 'account.needSignup') { \danog\MadelineProto\Logger::log('Registering new user', \danog\MadelineProto\Logger::NOTICE); - $authorization = $MadelineProto->complete_signup(\readline('Please enter your first name: '), \readline('Please enter your last name (can be empty): ')); + $authorization = $MadelineProto->completeSignup(\readline('Please enter your first name: '), \readline('Please enter your last name (can be empty): ')); } \danog\MadelineProto\Logger::log($authorization, \danog\MadelineProto\Logger::NOTICE); $Lua = new \danog\MadelineProto\Lua('madeline.lua', $MadelineProto); break; case 'b': - $authorization = $MadelineProto->bot_login(\readline('Please enter a bot token: ')); + $authorization = $MadelineProto->botLogin(\readline('Please enter a bot token: ')); \danog\MadelineProto\Logger::log($authorization, \danog\MadelineProto\Logger::NOTICE); $Lua = new \danog\MadelineProto\Lua('madeline.lua', $MadelineProto); break; @@ -56,10 +56,10 @@ if (!\is_object($Lua)) { $offset = 0; while (true) { - $updates = $Lua->MadelineProto->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout + $updates = $Lua->MadelineProto->getUpdates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout foreach ($updates as $update) { $offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id - $Lua->tdcli_update_callback($update['update']); + $Lua->tdcliUpdateCallback($update['update']); } echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('td.madeline', $Lua).' bytes'.PHP_EOL; } diff --git a/examples/pwrtelegram_debug_bot.php b/examples/pwrtelegram_debug_bot.php index 8b041264..41d01ada 100755 --- a/examples/pwrtelegram_debug_bot.php +++ b/examples/pwrtelegram_debug_bot.php @@ -27,14 +27,14 @@ try { $MadelineProto = new \danog\MadelineProto\API('b.madeline'); } catch (\danog\MadelineProto\Exception $e) { $MadelineProto = new \danog\MadelineProto\API($settings); - $authorization = $MadelineProto->bot_login($pwrtelegram_debug_token); + $authorization = $MadelineProto->botLogin($pwrtelegram_debug_token); \danog\MadelineProto\Logger::log($authorization, \danog\MadelineProto\Logger::NOTICE); } -function base64url_decode($data) +function base64urlDecode($data) { return \base64_decode(\str_pad(\strtr($data, '-_', '+/'), \strlen($data) % 4, '=', STR_PAD_RIGHT)); } -function rle_decode($string) +function rleDecode($string) { $base256 = ''; $last = ''; @@ -118,7 +118,7 @@ function recurse($array, $prefix = '') } $offset = 0; while (true) { - $updates = $MadelineProto->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout + $updates = $MadelineProto->getUpdates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout foreach ($updates as $update) { $offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id switch ($update['update']['_']) { @@ -131,8 +131,8 @@ while (true) { if (isset($update['update']['message']['media'])) { getfiles($pwrtelegram_debug_token, $res); $bot_api_id = $message = $res['files'][$update['update']['message']['id']]; - $bot_api_id_b256 = base64url_decode($bot_api_id); - $bot_api_id_rledecoded = rle_decode($bot_api_id_b256); + $bot_api_id_b256 = base64urlDecode($bot_api_id); + $bot_api_id_rledecoded = rleDecode($bot_api_id_b256); $message .= PHP_EOL.PHP_EOL; for ($x = 0; $x < \strlen($bot_api_id_rledecoded) - 3; $x++) { $message .= 'Bytes '.$x.'-'.($x + 4).': '.\danog\PHP\Struct::unpack('param (value): start-end (length)'.PHP_EOL.PHP_EOL; $bot_api = foreach_offset_length($bot_api_id_rledecoded); - //$mtproto = $MadelineProto->get_download_info($update['update']['message']['media'])['InputFileLocation']; + //$mtproto = $MadelineProto->getDownloadInfo($update['update']['message']['media'])['InputFileLocation']; //unset($mtproto['_']); $m = []; $mtproto = recurse($update['update']['message']); @@ -198,7 +198,7 @@ while (true) { try { if (isset($update['update']['message']['media']) && $update['update']['message']['media'] == 'messageMediaPhoto' && $update['update']['message']['media'] == 'messageMediaDocument') { $time = \time(); - // $file = $MadelineProto->download_to_dir($update['update']['message']['media'], '/tmp'); + // $file = $MadelineProto->downloadToDir($update['update']['message']['media'], '/tmp'); // $MadelineProto->messages->sendMessage(['peer' => $update['update']['message']['from_id'], 'message' => 'Downloaded to '.$file.' in '.(time() - $time).' seconds', 'reply_to_msg_id' => $update['update']['message']['id'], 'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]); } } catch (\danog\MadelineProto\RPCErrorException $e) { diff --git a/examples/secret_bot.php b/examples/secret_bot.php index cce7a8f3..8fa7d398 100755 --- a/examples/secret_bot.php +++ b/examples/secret_bot.php @@ -41,7 +41,7 @@ class EventHandler extends \danog\MadelineProto\EventHandler { try { if (isset($update['message']['decrypted_message']['media'])) { - \danog\MadelineProto\Logger::log($this->download_to_dir($update, '.')); + \danog\MadelineProto\Logger::log($this->downloadToDir($update, '.')); } if (isset($this->sent[$update['message']['chat_id']])) { return; diff --git a/src/danog/MadelineProto/API.php b/src/danog/MadelineProto/API.php index 4217afe6..80a12787 100644 --- a/src/danog/MadelineProto/API.php +++ b/src/danog/MadelineProto/API.php @@ -226,8 +226,8 @@ class API extends InternalDoc } $methods = \get_class_methods($this->API); foreach ($methods as $method) { - if ($method == 'method_call_async_read') { - unset($methods[\array_search('method_call', $methods)]); + if ($method == 'methodCallAsyncRead') { + unset($methods[\array_search('methodCall', $methods)]); } elseif (\stripos($method, 'async') !== false) { if (\strpos($method, '_async') !== false) { unset($methods[\array_search(\str_ireplace('_async', '', $method), $methods)]); @@ -240,8 +240,8 @@ class API extends InternalDoc foreach ($methods as $method) { $actual_method = $method; - if ($method == 'method_call_async_read') { - $method = 'method_call'; + if ($method == 'methodCallAsyncRead') { + $method = 'methodCall'; } elseif (\stripos($method, 'async') !== false) { if (\strpos($method, '_async') !== false) { $method = \str_ireplace('_async', '', $method); @@ -249,7 +249,7 @@ class API extends InternalDoc $method = \str_ireplace('async', '', $method); } } - $actual_method = $actual_method === 'get_self_async' ? [$this, 'my_get_self'] : [$this->API, $actual_method]; + $actual_method = $actual_method === 'getSelf' ? [$this, 'myGetSelf'] : [$this->API, $actual_method]; $this->methods[\strtolower($method)] = $actual_method; if (\strpos($method, '_') !== false) { $this->methods[\strtolower(\str_replace('_', '', $method))] = $actual_method; diff --git a/src/danog/MadelineProto/AnnotationsBuilder.php b/src/danog/MadelineProto/AnnotationsBuilder.php index 4f73c9db..66bc25e6 100644 --- a/src/danog/MadelineProto/AnnotationsBuilder.php +++ b/src/danog/MadelineProto/AnnotationsBuilder.php @@ -143,8 +143,8 @@ class AnnotationsBuilder $methods = $class->getMethods(\ReflectionMethod::IS_STATIC | \ReflectionMethod::IS_PUBLIC); foreach ($methods as $key => $method) { $name = $method->getName(); - if ($method == 'method_call_async_read') { - unset($methods[\array_search('method_call', $methods)]); + if ($method == 'methodCallAsyncRead') { + unset($methods[\array_search('methodCall', $methods)]); } elseif (\strpos($name, '__') === 0) { unset($methods[$key]); } elseif (\stripos($name, 'async') !== false) { @@ -161,8 +161,8 @@ class AnnotationsBuilder continue; } - if ($name == 'method_call_async_read') { - $name = 'method_call'; + if ($name == 'methodCallAsyncRead') { + $name = 'methodCall'; } elseif (\stripos($name, 'async') !== false) { if (\strpos($name, '_async') !== false) { $name = \str_ireplace('_async', '', $name); diff --git a/src/danog/MadelineProto/CombinedAPI.php b/src/danog/MadelineProto/CombinedAPI.php index ad211a6c..b4e06f50 100644 --- a/src/danog/MadelineProto/CombinedAPI.php +++ b/src/danog/MadelineProto/CombinedAPI.php @@ -238,8 +238,8 @@ class CombinedAPI if ($instance->API->authorized !== MTProto::LOGGED_IN) { continue; } - if (!$instance->API->settings['updates']['handle_updates']) { - $instance->API->settings['updates']['handle_updates'] = true; + if (!$instance->API->settings['updates']['handleUpdates']) { + $instance->API->settings['updates']['handleUpdates'] = true; $instance->API->startUpdateSystem(); } $instance->setCallback(function ($update) use ($path) { diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index 9e73ad42..0ca4440f 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -398,7 +398,7 @@ class Connection extends Session * // only in outgoing messages * 'body' => deserialized body, (optional if container) * 'serialized_body' => 'serialized body', (optional if container) - * 'content_related' => bool, + * 'contentRelated' => bool, * '_' => 'predicate', * 'promise' => deferred promise that gets resolved when a response to the message is received (optional), * 'send_promise' => deferred promise that gets resolved when the message is sent (optional), @@ -431,10 +431,10 @@ class Connection extends Session if (!isset($message['serialized_body'])) { $body = \is_object($message['body']) ? yield $message['body'] : $message['body']; - $refresh_next = isset($message['refresh_next']) && $message['refresh_next']; - //$refresh_next = true; + $refreshNext = isset($message['refreshNext']) && $message['refreshNext']; + //$refreshNext = true; - if ($refresh_next) { + if ($refreshNext) { $this->API->referenceDatabase->refreshNext(true); } @@ -443,7 +443,7 @@ class Connection extends Session } else { $body = yield $this->API->serializeObject(['type' => $message['_']], $body, $message['_']); } - if ($refresh_next) { + if ($refreshNext) { $this->API->referenceDatabase->refreshNext(false); } $message['serialized_body'] = $body; diff --git a/src/danog/MadelineProto/DataCenter.php b/src/danog/MadelineProto/DataCenter.php index 8338582d..a93f668b 100644 --- a/src/danog/MadelineProto/DataCenter.php +++ b/src/danog/MadelineProto/DataCenter.php @@ -433,7 +433,7 @@ class DataCenter } // The following hack looks like the only way to detect connection refused errors with PHP's stream sockets. - if (\stream_socket_get_name($socket, true) === false) { + if (\stream_socket_getName($socket, true) === false) { \fclose($socket); throw new ConnectException(\sprintf( "Connection to %s refused%s", diff --git a/src/danog/MadelineProto/DocsBuilder.php b/src/danog/MadelineProto/DocsBuilder.php index 6c0b55f1..836aa3ed 100644 --- a/src/danog/MadelineProto/DocsBuilder.php +++ b/src/danog/MadelineProto/DocsBuilder.php @@ -158,7 +158,7 @@ A [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputDia The following syntax can also be used: ``` -$'.$type.' = -147286699; // Numeric chat id returned by request_secret_chat, can be positive or negative +$'.$type.' = -147286699; // Numeric chat id returned by requestSecretChat, can be positive or negative ``` @@ -215,7 +215,7 @@ $result = $'.$type.'->click(); * [Updates](Updates.md) - If the button is a keyboardButton, the message will be sent to the chat, in reply to the message with the keyboard -* [messages_BotCallbackAnswer](messages_BotCallbackAnswer.md) - If the button is a keyboardButtonCallback or a keyboardButtonGame the button will be pressed and the result will be returned +* [messages.BotCallbackAnswer](messages.BotCallbackAnswer.md) - If the button is a keyboardButtonCallback or a keyboardButtonGame the button will be pressed and the result will be returned * `false` - If the button is an unsupported button, like keyboardButtonRequestPhone, keyboardButtonRequestGeoLocation, keyboardButtonSwitchInlinekeyboardButtonBuy; you will have to parse data from these buttons manually diff --git a/src/danog/MadelineProto/DocsBuilder/Constructors.php b/src/danog/MadelineProto/DocsBuilder/Constructors.php index ae4f46ee..25d9f4b2 100644 --- a/src/danog/MadelineProto/DocsBuilder/Constructors.php +++ b/src/danog/MadelineProto/DocsBuilder/Constructors.php @@ -233,11 +233,11 @@ You can provide bot API reply_markup objects here. } if ($hasentities) { $example .= ' -## Usage of parse_mode: +## Usage of parseMode: -Set parse_mode to html to enable HTML parsing of the message. +Set parseMode to html to enable HTML parsing of the message. -Set parse_mode to Markdown to enable markown AND html parsing of the message. +Set parseMode to Markdown to enable markown AND html parsing of the message. The following tags are currently supported: diff --git a/src/danog/MadelineProto/DocsBuilder/Methods.php b/src/danog/MadelineProto/DocsBuilder/Methods.php index 2214aaaa..54078000 100644 --- a/src/danog/MadelineProto/DocsBuilder/Methods.php +++ b/src/danog/MadelineProto/DocsBuilder/Methods.php @@ -53,7 +53,7 @@ trait Methods $this->human_docs_methods = []; $this->logger->logger('Generating methods documentation...', \danog\MadelineProto\Logger::NOTICE); foreach ($this->methods->by_id as $id => $data) { - $method = \str_replace('.', '_', $data['method']); + $method = $data['method']; $php_method = \str_replace('.', '->', $data['method']); $type = \str_replace(['.', '<', '>'], ['_', '_of_', ''], $data['type']); $php_type = \preg_replace('/.*_of_/', '', $type); @@ -77,7 +77,7 @@ trait Methods } $type_or_subtype = isset($param['subtype']) ? 'subtype' : 'type'; $type_or_bare_type = \ctype_upper($this->end(\explode('.', $param[$type_or_subtype]))[0]) || \in_array($param[$type_or_subtype], ['!X', 'X', 'bytes', 'true', 'false', 'double', 'string', 'Bool', 'int', 'long', 'int128', 'int256', 'int512', 'int53']) ? 'types' : 'constructors'; - $param[$type_or_subtype] = \str_replace(['.', 'true', 'false'], ['_', 'Bool', 'Bool'], $param[$type_or_subtype]); + $param[$type_or_subtype] = \str_replace(['true', 'false'], ['Bool', 'Bool'], $param[$type_or_subtype]); $param[$type_or_subtype] = '['.$this->escape($param[$type_or_subtype]).'](../'.$type_or_bare_type.'/'.$param[$type_or_subtype].'.md)'; $params .= "'".$param['name']."' => ".(isset($param['subtype']) ? '\\['.$param[$type_or_subtype].'\\]' : $param[$type_or_subtype]).', '; } @@ -134,7 +134,7 @@ trait Methods $param['type'] = 'Vector t'; $param['subtype'] = 'int'; } - $ptype = \str_replace('.', '_', $param[$type_or_subtype = isset($param['subtype']) ? 'subtype' : 'type']); + $ptype = $param[$type_or_subtype = isset($param['subtype']) ? 'subtype' : 'type']; switch ($ptype) { case 'true': case 'false': @@ -194,9 +194,9 @@ trait Methods $table .= '|parse\\_mode| [string](../types/string.md) | Whether to parse HTML or Markdown markup in the message| Optional | '; $params .= "'parse_mode' => 'string', "; - $lua_params .= "parse_mode='string', "; - $json_params .= '"parse_mode": "string"'; - $pwr_params = "parse_mode - string\n"; + $lua_params .= "parseMode='string', "; + $json_params .= '"parseMode": "string"'; + $pwr_params = "parseMode - string\n"; } } $description = isset($this->td_descriptions['methods'][$data['method']]) ? $this->td_descriptions['methods'][$data['method']]['description'] : $data['method'].' parameters, return type and example'; @@ -275,11 +275,11 @@ If the length of the provided message is bigger than 4096, the message will be s } if ($hasentities) { $example .= ' -## Usage of parse_mode: +## Usage of parseMode: -Set parse_mode to html to enable HTML parsing of the message. +Set parseMode to html to enable HTML parsing of the message. -Set parse_mode to Markdown to enable markown AND html parsing of the message. +Set parseMode to Markdown to enable markown AND html parsing of the message. The following tags are currently supported: @@ -351,29 +351,29 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png $MadelineProto->[logout](https://docs.madelineproto.xyz/logout.html)(); -$MadelineProto->[phone_login](https://docs.madelineproto.xyz/phone_login.html)($number); +$MadelineProto->[phoneLogin](https://docs.madelineproto.xyz/phoneLogin.html)($number); -$MadelineProto->[complete_phone_login](https://docs.madelineproto.xyz/complete_phone_login.html)($code); +$MadelineProto->[completePhoneLogin](https://docs.madelineproto.xyz/completePhoneLogin.html)($code); $MadelineProto->[complete_2FA_login](https://docs.madelineproto.xyz/complete_2FA_login.html)($password); -$MadelineProto->[bot_login](https://docs.madelineproto.xyz/bot_login.html)($token); +$MadelineProto->[botLogin](https://docs.madelineproto.xyz/botLogin.html)($token); -$MadelineProto->[get_dialogs](https://docs.madelineproto.xyz/get_dialogs.html)(); +$MadelineProto->[getDialogs](https://docs.madelineproto.xyz/getDialogs.html)(); -$MadelineProto->[get_pwr_chat](https://docs.madelineproto.xyz/get_pwr_chat.html)($id); +$MadelineProto->[getPwrChat](https://docs.madelineproto.xyz/getPwrChat.html)($id); -$MadelineProto->[get_info](https://docs.madelineproto.xyz/get_info.html)($id); +$MadelineProto->[getInfo](https://docs.madelineproto.xyz/getInfo.html)($id); -$MadelineProto->[get_full_info](https://docs.madelineproto.xyz/get_full_info.html)($id); +$MadelineProto->[getFullInfo](https://docs.madelineproto.xyz/getFullInfo.html)($id); -$MadelineProto->[get_self](https://docs.madelineproto.xyz/get_self.html)(); +$MadelineProto->[getSelf](https://docs.madelineproto.xyz/getSelf.html)(); -$MadelineProto->[request_call](https://docs.madelineproto.xyz/request_call.html)($id); +$MadelineProto->[requestCall](https://docs.madelineproto.xyz/requestCall.html)($id); -$MadelineProto->[request_secret_chat](https://docs.madelineproto.xyz/request_secret_chat.html)($id); +$MadelineProto->[requestSecretChat](https://docs.madelineproto.xyz/requestSecretChat.html)($id); '.\implode('', $this->docs_methods)); @@ -395,13 +395,13 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png * [Get all chats, broadcast a message to all chats](https://docs.madelineproto.xyz/docs/DIALOGS.html) -* [Get the full participant list of a channel/group/supergroup](https://docs.madelineproto.xyz/get_pwr_chat.html) +* [Get the full participant list of a channel/group/supergroup](https://docs.madelineproto.xyz/getPwrChat.html) -* [Get full info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/get_full_info.html) +* [Get full info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/getFullInfo.html) -* [Get info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/get_info.html) +* [Get info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/getInfo.html) -* [Get info about the currently logged-in user](https://docs.madelineproto.xyz/get_self.html) +* [Get info about the currently logged-in user](https://docs.madelineproto.xyz/getSelf.html) * [Upload or download files up to 1.5 GB](https://docs.madelineproto.xyz/docs/FILES.html) diff --git a/src/danog/MadelineProto/InternalDoc.php b/src/danog/MadelineProto/InternalDoc.php index 08ce4c7a..ee65fc74 100644 --- a/src/danog/MadelineProto/InternalDoc.php +++ b/src/danog/MadelineProto/InternalDoc.php @@ -10,13 +10,13 @@ namespace danog\MadelineProto; interface auth { /** - * Use phone_login instead. + * Use phoneLogin instead. * * Parameters: - * * `string` **phone_number** - Use phone_login instead - * * `int` **api_id** - Use phone_login instead - * * `string` **api_hash** - Use phone_login instead - * * `CodeSettings` **settings** - You cannot use this method directly, use the phone_login method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **phone_number** - Use phoneLogin instead + * * `int` **api_id** - Use phoneLogin instead + * * `string` **api_hash** - Use phoneLogin instead + * * `CodeSettings` **settings** - You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) * * @param array $params Parameters * @@ -25,13 +25,13 @@ interface auth public function sendCode($params); /** - * You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info). + * You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info). * * Parameters: - * * `string` **phone_number** - You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info) - * * `string` **phone_code_hash** - You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info) - * * `string` **first_name** - You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info) - * * `string` **last_name** - You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **phone_number** - You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **phone_code_hash** - You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **first_name** - You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **last_name** - You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info) * * @param array $params Parameters * @@ -40,12 +40,12 @@ interface auth public function signUp($params); /** - * You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info). + * You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info). * * Parameters: - * * `string` **phone_number** - You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info) - * * `string` **phone_code_hash** - You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info) - * * `string` **phone_code** - You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **phone_number** - You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **phone_code_hash** - You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **phone_code** - You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info) * * @param array $params Parameters * @@ -68,10 +68,10 @@ interface auth public function resetAuthorizations(); /** - * You cannot use this method directly, use $MadelineProto->export_authorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html. + * You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html. * * Parameters: - * * `int` **dc_id** - You cannot use this method directly, use $MadelineProto->export_authorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html + * * `int` **dc_id** - You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html * * @param array $params Parameters * @@ -80,11 +80,11 @@ interface auth public function exportAuthorization($params); /** - * You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html. + * You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html. * * Parameters: - * * `int` **id** - You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html - * * `bytes` **bytes** - You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html + * * `int` **id** - You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html + * * `bytes` **bytes** - You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html * * @param array $params Parameters * @@ -108,12 +108,12 @@ interface auth public function bindTempAuthKey($params); /** - * You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info). + * You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info). * * Parameters: - * * `int` **api_id** - You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info) - * * `string` **api_hash** - You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info) - * * `string` **bot_auth_token** - You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info) + * * `int` **api_id** - You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **api_hash** - You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **bot_auth_token** - You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info) * * @param array $params Parameters * @@ -952,10 +952,10 @@ interface users public function getUsers($params); /** - * You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info). + * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info). * * Parameters: - * * `InputUser` **id** - You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info) + * * `InputUser` **id** - You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info) * * @param array $params Parameters * @@ -1097,10 +1097,10 @@ interface contacts public function search($params); /** - * You cannot use this method directly, use the resolve_username, get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info). + * You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info). * * Parameters: - * * `string` **username** - You cannot use this method directly, use the resolve_username, get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info) + * * `string` **username** - You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info) * * @param array $params Parameters * @@ -1225,7 +1225,7 @@ interface messages public function getMessages($params); /** - * Gets list of chats: you should use $MadelineProto->get_dialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html. + * Gets list of chats: you should use $MadelineProto->getDialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html. * * Parameters: * * `boolean` **exclude_pinned** - Optional: Do not fetch pinned chats @@ -1462,10 +1462,10 @@ interface messages public function getChats($params); /** - * You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info). + * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info). * * Parameters: - * * `InputPeer` **chat_id** - You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info) + * * `InputPeer` **chat_id** - You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info) * * @param array $params Parameters * @@ -1540,11 +1540,11 @@ interface messages public function createChat($params); /** - * You cannot use this method directly, instead use $MadelineProto->get_dh_config();. + * You cannot use this method directly, instead use $MadelineProto->getDhConfig();. * * Parameters: - * * `int` **version** - You cannot use this method directly, instead use $MadelineProto->get_dh_config(); - * * `int` **random_length** - You cannot use this method directly, instead use $MadelineProto->get_dh_config(); + * * `int` **version** - You cannot use this method directly, instead use $MadelineProto->getDhConfig(); + * * `int` **random_length** - You cannot use this method directly, instead use $MadelineProto->getDhConfig(); * * @param array $params Parameters * @@ -2896,12 +2896,12 @@ interface photos interface upload { /** - * You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info. + * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. * * Parameters: - * * `long` **file_id** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `int` **file_part** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `bytes` **bytes** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info + * * `long` **file_id** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `int` **file_part** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `bytes` **bytes** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info * * @param array $params Parameters * @@ -2910,13 +2910,13 @@ interface upload public function saveFilePart($params); /** - * You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info. + * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. * * Parameters: - * * `boolean` **precise** - Optional: You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `InputFileLocation` **location** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `int` **offset** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `int` **limit** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info + * * `boolean` **precise** - Optional: You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `InputFileLocation` **location** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `int` **offset** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `int` **limit** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info * * @param array $params Parameters * @@ -2925,13 +2925,13 @@ interface upload public function getFile($params); /** - * You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info. + * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. * * Parameters: - * * `long` **file_id** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `int` **file_part** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `int` **file_total_parts** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `bytes` **bytes** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info + * * `long` **file_id** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `int` **file_part** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `int` **file_total_parts** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `bytes` **bytes** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info * * @param array $params Parameters * @@ -2954,12 +2954,12 @@ interface upload public function getWebFile($params); /** - * You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info. + * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. * * Parameters: - * * `bytes` **file_token** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `int` **offset** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `int` **limit** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info + * * `bytes` **file_token** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `int` **offset** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `int` **limit** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info * * @param array $params Parameters * @@ -2968,11 +2968,11 @@ interface upload public function getCdnFile($params); /** - * You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info. + * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. * * Parameters: - * * `bytes` **file_token** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `bytes` **request_token** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info + * * `bytes` **file_token** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `bytes` **request_token** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info * * @param array $params Parameters * @@ -2981,11 +2981,11 @@ interface upload public function reuploadCdnFile($params); /** - * You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info. + * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. * * Parameters: - * * `bytes` **file_token** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info - * * `int` **offset** - You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info + * * `bytes` **file_token** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info + * * `int` **offset** - You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info * * @param array $params Parameters * @@ -3265,7 +3265,7 @@ interface channels public function getMessages($params); /** - * Get channel/supergroup participants (you should use `$MadelineProto->get_pwr_chat($id)` instead). + * Get channel/supergroup participants (you should use `$MadelineProto->getPwrChat($id)` instead). * * Parameters: * * `InputChannel` **channel** - The channel @@ -3306,10 +3306,10 @@ interface channels public function getChannels($params); /** - * You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info). + * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info). * * Parameters: - * * `InputChannel` **channel** - You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info) + * * `InputChannel` **channel** - You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info) * * @param array $params Parameters * @@ -4303,7 +4303,7 @@ class InternalDoc extends APIFactory return $this->__call(__FUNCTION__, [$id, $extra]); } /** - * Synchronous wrapper for method_call. + * Synchronous wrapper for methodCall. * * @param string $method Method name * @param array $args Arguments diff --git a/src/danog/MadelineProto/Lang.php b/src/danog/MadelineProto/Lang.php index ec2660bd..098605cc 100644 --- a/src/danog/MadelineProto/Lang.php +++ b/src/danog/MadelineProto/Lang.php @@ -40,7 +40,7 @@ class Lang 'socket_status_5' => 'AVVIATO', 'api_not_set' => 'Devi specificare una chiave ed un ID API, ottienili su https://my.telegram.org', 'session_corrupted' => 'La sessione si è corrotta!', - 'reset_session_seqno' => 'Resettando ID sessione e numero di sequenza sul DC %s...', + 'resetSession_seqno' => 'Resettando ID sessione e numero di sequenza sul DC %s...', 'gen_perm_auth_key' => 'Generando chiave di autorizzazione permanente per il DC %s...', 'gen_temp_auth_key' => 'Generando chiave di autorizzazione temporanea per il DC %s...', 'copy_auth_dcs' => 'Copiando autorizzazione dal DC %s al DC %s...', @@ -81,21 +81,21 @@ class Lang 'madelineproto_ready' => 'MadelineProto è pronto!', 'logout_error' => 'C\'è stato un errore durante il logout!', 'logout_ok' => 'Il logout è stato eseguito correttamente!', - 'already_logged_in' => 'Questa istanza di MadelineProto è già loggata, prima faccio il logout...', + 'already_loggedIn' => 'Questa istanza di MadelineProto è già loggata, prima faccio il logout...', 'login_ok' => 'Il login è stato eseguito correttamente!', 'login_user' => 'Sto eseguendo il login come utente normale...', 'login_bot' => 'Sto eseguendo il login come bot...', 'login_code_sending' => 'Sto inviando il codice...', - 'login_code_sent' => 'Il codice è stato inviato correttamente! Una volta ricevuto il codice dovrai usare la funzione complete_phone_login.', - 'login_code_uncalled' => 'Non sto aspettando il codice! Usa la funzione phone_login.', + 'login_code_sent' => 'Il codice è stato inviato correttamente! Una volta ricevuto il codice dovrai usare la funzione completePhoneLogin.', + 'login_code_uncalled' => 'Non sto aspettando il codice! Usa la funzione phoneLogin.', 'login_2fa_enabled' => 'L\'autenticazione a due fattori è abilitata, dovrai chiamare il metodo complete_2fa_login...', - 'login_need_signup' => 'Questo numero non è registrato su telegram, dovrai chiamare la funzione complete_signup...', + 'login_need_signup' => 'Questo numero non è registrato su telegram, dovrai chiamare la funzione completeSignup...', 'login_auth_key' => 'Sto facendo il login con la chiave di autorizzazione...', - 'not_logged_in' => 'Non ho ancora fatto il login!', - 'signup_uncalled' => 'Chiama prima le funzioni phone_login e complete_phone_login.', + 'not_loggedIn' => 'Non ho ancora fatto il login!', + 'signup_uncalled' => 'Chiama prima le funzioni phoneLogin e completePhoneLogin.', 'signing_up' => 'Mi sto registrando su telegram come utente normale...', 'signup_ok' => 'Mi sono registrato su Telegram!', - '2fa_uncalled' => 'Non sto aspettando la password, chiama prima le funzioni phone_login e complete_phone_login!', + '2fa_uncalled' => 'Non sto aspettando la password, chiama prima le funzioni phoneLogin e completePhoneLogin!', 'getting_dialogs' => 'Sto ottenendo la lista delle chat...', 'libtgvoip_required' => 'È necessario installare l\'estensione php-libtgvoip per accettare e gestire chiamate vocali, vistate https://docs.madelineproto.xyz per più info.', 'peer_not_in_db' => 'Questo utente/gruppo/canale non è presente nel database interno MadelineProto', @@ -187,7 +187,7 @@ class Lang 'socket_status_5' => 'WORKING', 'api_not_set' => 'You must provide an api key and an api id, get your own @ my.telegram.org', 'session_corrupted' => 'The session is corrupted!', - 'reset_session_seqno' => 'Resetting session id and seq_no in DC %s...', + 'resetSession_seqno' => 'Resetting session id and seq_no in DC %s...', 'gen_perm_auth_key' => 'Generating permanent authorization key for DC %s...', 'gen_temp_auth_key' => 'Generating temporary authorization key for DC %s...', 'copy_auth_dcs' => 'Copying authorization from DC %s to DC %s...', @@ -228,21 +228,21 @@ class Lang 'madelineproto_ready' => 'MadelineProto is ready!', 'logout_error' => 'An error occurred while logging out!', 'logout_ok' => 'Logged out successfully!', - 'already_logged_in' => 'This instance of MadelineProto is already logged in. Logging out first...', + 'already_loggedIn' => 'This instance of MadelineProto is already logged in. Logging out first...', 'login_ok' => 'Logged in successfully!', 'login_user' => 'Logging in as a normal user...', 'login_bot' => 'Logging in as a bot...', 'login_code_sending' => 'Sending code...', - 'login_code_sent' => 'Code sent successfully! Once you receive the code you should use the complete_phone_login function.', - 'login_code_uncalled' => 'I\'m not waiting for the code! Please call the phone_login method first', + 'login_code_sent' => 'Code sent successfully! Once you receive the code you should use the completePhoneLogin function.', + 'login_code_uncalled' => 'I\'m not waiting for the code! Please call the phoneLogin method first', 'login_2fa_enabled' => '2FA enabled, you will have to call the complete_2fa_login function...', - 'login_need_signup' => 'An account has not been created for this number, you will have to call the complete_signup function...', + 'login_need_signup' => 'An account has not been created for this number, you will have to call the completeSignup function...', 'login_auth_key' => 'Logging in using auth key...', - 'not_logged_in' => 'I\'m not logged in!', - 'signup_uncalled' => 'I\'m not waiting to signup! Please call the phone_login and the complete_phone_login methods first!', + 'not_loggedIn' => 'I\'m not logged in!', + 'signup_uncalled' => 'I\'m not waiting to signup! Please call the phoneLogin and the completePhoneLogin methods first!', 'signing_up' => 'Signing up as a normal user...', 'signup_ok' => 'Signed up in successfully!', - '2fa_uncalled' => 'I\'m not waiting for the password! Please call the phone_login and the complete_phone_login methods first!', + '2fa_uncalled' => 'I\'m not waiting for the password! Please call the phoneLogin and the completePhoneLogin methods first!', 'getting_dialogs' => 'Getting dialogs...', 'libtgvoip_required' => 'The php-libtgvoip extension is required to accept and manage calls. See daniil.it/MadelineProto for more info.', 'peer_not_in_db' => 'This peer is not present in the internal peer database', @@ -355,41 +355,41 @@ class Lang 'method_invokeWithoutUpdates_param_query_type_!X' => 'The query', 'method_auth.checkPhone' => 'Check if this phone number is registered on telegram', 'method_auth.checkPhone_param_phone_number_type_string' => 'The phone number to check', - 'method_auth.sendCode' => 'Use phone_login instead', - 'method_auth.sendCode_param_allow_flashcall_type_true' => 'Use phone_login instead', - 'method_auth.sendCode_param_phone_number_type_string' => 'Use phone_login instead', - 'method_auth.sendCode_param_current_number_type_Bool' => 'Use phone_login instead', - 'method_auth.sendCode_param_api_id_type_int' => 'Use phone_login instead', - 'method_auth.sendCode_param_api_hash_type_string' => 'Use phone_login instead', - 'method_auth.signUp' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_phone_number_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_phone_code_hash_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_phone_code_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_first_name_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_last_name_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signIn' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signIn_param_phone_number_type_string' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signIn_param_phone_code_hash_type_string' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signIn_param_phone_code_type_string' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.sendCode' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_allow_flashcall_type_true' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_phone_number_type_string' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_current_number_type_Bool' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_api_id_type_int' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_api_hash_type_string' => 'Use phoneLogin instead', + 'method_auth.signUp' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_phone_number_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_phone_code_hash_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_phone_code_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_first_name_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_last_name_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signIn' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signIn_param_phone_number_type_string' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signIn_param_phone_code_hash_type_string' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signIn_param_phone_code_type_string' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.logOut' => 'You cannot use this method directly, use the logout method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.resetAuthorizations' => 'Delete all logged-in sessions.', 'method_auth.sendInvites' => 'Invite friends to telegram!', 'method_auth.sendInvites_param_phone_numbers_type_Vector t' => 'Phone numbers to invite', 'method_auth.sendInvites_param_message_type_string' => 'The message to send', - 'method_auth.exportAuthorization' => 'You cannot use this method directly, use $MadelineProto->export_authorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', - 'method_auth.exportAuthorization_param_dc_id_type_int' => 'You cannot use this method directly, use $MadelineProto->export_authorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', - 'method_auth.importAuthorization' => 'You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', - 'method_auth.importAuthorization_param_id_type_int' => 'You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', - 'method_auth.importAuthorization_param_bytes_type_bytes' => 'You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.exportAuthorization' => 'You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.exportAuthorization_param_dc_id_type_int' => 'You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.importAuthorization' => 'You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.importAuthorization_param_id_type_int' => 'You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.importAuthorization_param_bytes_type_bytes' => 'You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', 'method_auth.bindTempAuthKey' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'method_auth.bindTempAuthKey_param_perm_auth_key_id_type_long' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'method_auth.bindTempAuthKey_param_nonce_type_long' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'method_auth.bindTempAuthKey_param_expires_at_type_int' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'method_auth.bindTempAuthKey_param_encrypted_message_type_bytes' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', - 'method_auth.importBotAuthorization' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_api_id_type_int' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_api_hash_type_string' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_bot_auth_token_type_string' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_api_id_type_int' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_api_hash_type_string' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_bot_auth_token_type_string' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.checkPassword' => 'You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.checkPassword_param_password_hash_type_bytes' => 'You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.requestPasswordRecovery' => 'Send an email to recover the 2FA password', @@ -477,8 +477,8 @@ class Lang 'method_account.resetWebAuthorizations' => 'Reset all telegram web login authorizations', 'method_users.getUsers' => 'Get info about users', 'method_users.getUsers_param_id_type_Vector t' => 'The ids of the users', - 'method_users.getFullUser' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', - 'method_users.getFullUser_param_id_type_InputUser' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_users.getFullUser' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_users.getFullUser_param_id_type_InputUser' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'method_contacts.getStatuses' => 'Get online status of all users', 'method_contacts.getContacts' => 'Get all contacts', 'method_contacts.getContacts_param_hash_type_int' => 'User ids of contacts previously fetched with this method', @@ -501,8 +501,8 @@ class Lang 'method_contacts.search' => 'Search contacts', 'method_contacts.search_param_q_type_string' => 'The search query', 'method_contacts.search_param_limit_type_int' => 'How many results should be returned', - 'method_contacts.resolveUsername' => 'You cannot use this method directly, use the resolve_username, get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', - 'method_contacts.resolveUsername_param_username_type_string' => 'You cannot use this method directly, use the resolve_username, get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_contacts.resolveUsername' => 'You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_contacts.resolveUsername_param_username_type_string' => 'You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'method_contacts.getTopPeers' => 'Get most used chats', 'method_contacts.getTopPeers_param_correspondents_type_true' => 'Fetch users?', 'method_contacts.getTopPeers_param_bots_pm_type_true' => 'Fetch bots?', @@ -519,7 +519,7 @@ class Lang 'method_contacts.resetSaved' => 'Reset saved contacts', 'method_messages.getMessages' => 'Get messages', 'method_messages.getMessages_param_id_type_Vector t' => 'The IDs of messages to fetch (only for users and normal groups)', - 'method_messages.getDialogs' => 'Gets list of chats: you should use $MadelineProto->get_dialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html', + 'method_messages.getDialogs' => 'Gets list of chats: you should use $MadelineProto->getDialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html', 'method_messages.getDialogs_param_exclude_pinned_type_true' => 'Do not fetch pinned chats', 'method_messages.getDialogs_param_offset_date_type_int' => 'End($res[\'messages\'])[\'date\'];', 'method_messages.getDialogs_param_offset_id_type_int' => 'End($res[\'messages\'])[\'id\'];', @@ -597,8 +597,8 @@ class Lang 'method_messages.getPeerSettings_param_peer_type_InputPeer' => 'The peer', 'method_messages.getChats' => 'Get info about chats', 'method_messages.getChats_param_id_type_Vector t' => 'The MTProto IDs of chats to fetch info about', - 'method_messages.getFullChat' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', - 'method_messages.getFullChat_param_chat_id_type_InputPeer' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_messages.getFullChat' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_messages.getFullChat_param_chat_id_type_InputPeer' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'method_messages.editChatTitle' => 'Edit the title of a normal chat (not supergroup)', 'method_messages.editChatTitle_param_chat_id_type_InputPeer' => 'The ID of the chat', 'method_messages.editChatTitle_param_title_type_string' => 'The new title', @@ -615,9 +615,9 @@ class Lang 'method_messages.createChat' => 'Create a chat (not supergroup)', 'method_messages.createChat_param_users_type_Vector t' => 'The users to add to the chat', 'method_messages.createChat_param_title_type_string' => 'The new chat\'s title', - 'method_messages.getDhConfig' => 'You cannot use this method directly, instead use $MadelineProto->get_dh_config();', - 'method_messages.getDhConfig_param_version_type_int' => 'You cannot use this method directly, instead use $MadelineProto->get_dh_config();', - 'method_messages.getDhConfig_param_random_length_type_int' => 'You cannot use this method directly, instead use $MadelineProto->get_dh_config();', + 'method_messages.getDhConfig' => 'You cannot use this method directly, instead use $MadelineProto->getDhConfig();', + 'method_messages.getDhConfig_param_version_type_int' => 'You cannot use this method directly, instead use $MadelineProto->getDhConfig();', + 'method_messages.getDhConfig_param_random_length_type_int' => 'You cannot use this method directly, instead use $MadelineProto->getDhConfig();', 'method_messages.requestEncryption' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'method_messages.requestEncryption_param_user_id_type_InputUser' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'method_messages.requestEncryption_param_g_a_type_bytes' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', @@ -891,33 +891,33 @@ class Lang 'method_photos.getUserPhotos_param_offset_type_int' => 'Offset', 'method_photos.getUserPhotos_param_max_id_type_long' => 'Maximum ID of photo to return', 'method_photos.getUserPhotos_param_limit_type_int' => 'Number of photos to return', - 'method_upload.saveFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveFilePart_param_file_id_type_long' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveFilePart_param_file_part_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveFilePart_param_bytes_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getFile_param_location_type_InputFileLocation' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getFile_param_offset_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getFile_param_limit_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart_param_file_id_type_long' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart_param_file_part_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart_param_file_total_parts_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart_param_bytes_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveFilePart' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveFilePart_param_file_id_type_long' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveFilePart_param_file_part_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveFilePart_param_bytes_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile_param_location_type_InputFileLocation' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile_param_offset_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile_param_limit_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart_param_file_id_type_long' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart_param_file_part_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart_param_file_total_parts_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart_param_bytes_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'method_upload.getWebFile' => 'Download a file through telegram', 'method_upload.getWebFile_param_location_type_InputWebFileLocation' => 'The file', 'method_upload.getWebFile_param_offset_type_int' => 'The offset in bytes', 'method_upload.getWebFile_param_limit_type_int' => 'The number of bytes to fetch', - 'method_upload.getCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFile_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFile_param_offset_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFile_param_limit_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.reuploadCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.reuploadCdnFile_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.reuploadCdnFile_param_request_token_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFileHashes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFileHashes_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFileHashes_param_offset_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFile' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFile_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFile_param_offset_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFile_param_limit_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.reuploadCdnFile' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.reuploadCdnFile_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.reuploadCdnFile_param_request_token_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFileHashes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFileHashes_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFileHashes_param_offset_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'method_help.getConfig' => 'Get server configuration', 'method_help.getNearestDc' => 'Get nearest datacenter', 'method_help.getAppUpdate' => 'Get info about app updates', @@ -950,7 +950,7 @@ class Lang 'method_channels.getMessages' => 'Get channel/supergroup messages', 'method_channels.getMessages_param_channel_type_InputChannel' => 'The channel/supergroup', 'method_channels.getMessages_param_id_type_Vector t' => 'The message IDs', - 'method_channels.getParticipants' => 'Get channel/supergroup participants (you should use `$MadelineProto->get_pwr_chat($id)` instead)', + 'method_channels.getParticipants' => 'Get channel/supergroup participants (you should use `$MadelineProto->getPwrChat($id)` instead)', 'method_channels.getParticipants_param_channel_type_InputChannel' => 'The channel', 'method_channels.getParticipants_param_filter_type_ChannelParticipantsFilter' => 'Member filter', 'method_channels.getParticipants_param_offset_type_int' => 'Offset', @@ -961,8 +961,8 @@ class Lang 'method_channels.getParticipant_param_user_id_type_InputUser' => 'The user to fetch info about', 'method_channels.getChannels' => 'Get info about multiple channels/supergroups', 'method_channels.getChannels_param_id_type_Vector t' => 'The channel/supergroup MTProto IDs', - 'method_channels.getFullChannel' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', - 'method_channels.getFullChannel_param_channel_type_InputChannel' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_channels.getFullChannel' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_channels.getFullChannel_param_channel_type_InputChannel' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'method_channels.createChannel' => 'Create channel/supergroup', 'method_channels.createChannel_param_broadcast_type_true' => 'Set this to true to create a channel', 'method_channels.createChannel_param_megagroup_type_true' => 'Set this to true to create a supergroup', @@ -1110,8 +1110,8 @@ class Lang 'method_langpack.getDifference' => 'Get language pack updates', 'method_langpack.getDifference_param_from_version_type_int' => 'Previous version', 'method_langpack.getLanguages' => 'Get available languages', - 'method_auth.sendCode_param_sms_type_type_int' => 'You cannot use this method directly, use the phone_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.sendCode_param_lang_code_type_string' => 'You cannot use this method directly, use the phone_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.sendCode_param_sms_type_type_int' => 'You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.sendCode_param_lang_code_type_string' => 'You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.sendCall' => 'Send verification phone call', 'method_auth.sendCall_param_phone_number_type_string' => 'The phone number', 'method_auth.sendCall_param_phone_code_hash_type_string' => 'The phone code hash', @@ -1272,10 +1272,10 @@ class Lang 'method_contest.saveDeveloperInfo_param_phone_number_type_string' => 'Phone number', 'method_contest.saveDeveloperInfo_param_age_type_int' => 'Age', 'method_contest.saveDeveloperInfo_param_city_type_string' => 'City', - 'method_auth.importBotAuthorization_param_a_type_true' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_b_type_true' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_c_type_true' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_d_type_true' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_a_type_true' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_b_type_true' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_c_type_true' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_d_type_true' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', 'object_vector' => 'Array', 'object_resPQ' => 'Contains pq to factorize', 'object_resPQ_param_nonce_type_int128' => 'Nonce', @@ -2871,23 +2871,23 @@ class Lang 'object_inputBotInlineResult_param_w_type_int' => 'Width', 'object_inputBotInlineResult_param_h_type_int' => 'Height', 'object_inputBotInlineResult_param_duration_type_int' => 'Duration', - 'object_inputBotInlineResult_param_send_message_type_InputBotInlineMessage' => 'Message to send', + 'object_inputBotInlineResult_param_sendMessage_type_InputBotInlineMessage' => 'Message to send', 'object_inputBotInlineResultPhoto' => 'Bot inline result photo', 'object_inputBotInlineResultPhoto_param_id_type_string' => 'ID', 'object_inputBotInlineResultPhoto_param_type_type_string' => 'Type', 'object_inputBotInlineResultPhoto_param_photo_type_InputPhoto' => 'Photo', - 'object_inputBotInlineResultPhoto_param_send_message_type_InputBotInlineMessage' => 'Message to send', + 'object_inputBotInlineResultPhoto_param_sendMessage_type_InputBotInlineMessage' => 'Message to send', 'object_inputBotInlineResultDocument' => 'Bot inline result document', 'object_inputBotInlineResultDocument_param_id_type_string' => 'ID', 'object_inputBotInlineResultDocument_param_type_type_string' => 'Type', 'object_inputBotInlineResultDocument_param_title_type_string' => 'Title', 'object_inputBotInlineResultDocument_param_description_type_string' => 'Description', 'object_inputBotInlineResultDocument_param_document_type_InputDocument' => 'Document', - 'object_inputBotInlineResultDocument_param_send_message_type_InputBotInlineMessage' => 'Message to send', + 'object_inputBotInlineResultDocument_param_sendMessage_type_InputBotInlineMessage' => 'Message to send', 'object_inputBotInlineResultGame' => 'Bot inline result game', 'object_inputBotInlineResultGame_param_id_type_string' => 'ID', 'object_inputBotInlineResultGame_param_short_name_type_string' => 'Short name', - 'object_inputBotInlineResultGame_param_send_message_type_InputBotInlineMessage' => 'Message to send', + 'object_inputBotInlineResultGame_param_sendMessage_type_InputBotInlineMessage' => 'Message to send', 'object_botInlineMessageMediaAuto' => 'Bot inline message media auto', 'object_botInlineMessageMediaAuto_param_message_type_string' => 'Message', 'object_botInlineMessageMediaAuto_param_entities_type_Vector t' => 'Entities', @@ -2925,7 +2925,7 @@ class Lang 'object_botInlineResult_param_w_type_int' => 'Width', 'object_botInlineResult_param_h_type_int' => 'Height', 'object_botInlineResult_param_duration_type_int' => 'Duration', - 'object_botInlineResult_param_send_message_type_BotInlineMessage' => 'Message to send', + 'object_botInlineResult_param_sendMessage_type_BotInlineMessage' => 'Message to send', 'object_botInlineMediaResult' => 'Bot inline media result', 'object_botInlineMediaResult_param_id_type_string' => 'ID', 'object_botInlineMediaResult_param_type_type_string' => 'Type', @@ -2933,7 +2933,7 @@ class Lang 'object_botInlineMediaResult_param_document_type_Document' => 'Document', 'object_botInlineMediaResult_param_title_type_string' => 'Title', 'object_botInlineMediaResult_param_description_type_string' => 'Description', - 'object_botInlineMediaResult_param_send_message_type_BotInlineMessage' => 'Send message', + 'object_botInlineMediaResult_param_sendMessage_type_BotInlineMessage' => 'Send message', 'object_messages.botResults' => 'Bot results', 'object_messages.botResults_param_gallery_type_true' => 'Gallery?', 'object_messages.botResults_param_query_id_type_long' => 'Query ID', @@ -3369,7 +3369,7 @@ class Lang 'object_channelAdminRights_param_add_admins_type_true' => 'Add other admins', 'object_channelBannedRights' => 'Banned user rights (when true, the user will NOT be able to do that thing)', 'object_channelBannedRights_param_view_messages_type_true' => 'Disallow viewing messages', - 'object_channelBannedRights_param_send_messages_type_true' => 'Disallow sending messages', + 'object_channelBannedRights_param_sendMessages_type_true' => 'Disallow sending messages', 'object_channelBannedRights_param_send_media_type_true' => 'Disallow sending media', 'object_channelBannedRights_param_send_stickers_type_true' => 'Disallow sending stickers', 'object_channelBannedRights_param_send_gifs_type_true' => 'Disallow sending gifs', @@ -4043,12 +4043,12 @@ class Lang 'object_botInlineMediaResultDocument_param_id_type_string' => 'ID', 'object_botInlineMediaResultDocument_param_type_type_string' => 'Type', 'object_botInlineMediaResultDocument_param_document_type_Document' => 'Document', - 'object_botInlineMediaResultDocument_param_send_message_type_BotInlineMessage' => 'Send message', + 'object_botInlineMediaResultDocument_param_sendMessage_type_BotInlineMessage' => 'Send message', 'object_botInlineMediaResultPhoto' => 'Bot inline media result photo', 'object_botInlineMediaResultPhoto_param_id_type_string' => 'ID', 'object_botInlineMediaResultPhoto_param_type_type_string' => 'Type', 'object_botInlineMediaResultPhoto_param_photo_type_Photo' => 'Photo', - 'object_botInlineMediaResultPhoto_param_send_message_type_BotInlineMessage' => 'Send message', + 'object_botInlineMediaResultPhoto_param_sendMessage_type_BotInlineMessage' => 'Send message', 'object_inputMediaVideo_param_video_type_InputVideo' => 'Video', 'object_inputMediaAudio_param_audio_type_InputAudio' => 'Audio', 'object_inputMediaDocument_param_document_id_type_InputDocument' => 'Document ID', @@ -4751,7 +4751,7 @@ class Lang 'object_chatOnlines_param_onlines_type_int' => 'Onlines', 'object_statsURL' => 'Stats URL', 'object_statsURL_param_url_type_string' => 'URL', - 'method_auth.sendCode_param_settings_type_CodeSettings' => 'You cannot use this method directly, use the phone_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.sendCode_param_settings_type_CodeSettings' => 'You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info)', 'method_account.getWallPapers_param_hash_type_Vector t' => 'IDs of previously fetched wallpapers', 'method_account.sendChangePhoneCode_param_settings_type_CodeSettings' => 'Code settings', 'method_account.sendConfirmPhoneCode_param_settings_type_CodeSettings' => 'Code settings', @@ -4825,7 +4825,7 @@ class Lang 'object_chatAdminRights_param_add_admins_type_true' => 'Can add other admins?', 'object_chatBannedRights' => 'Banned rights (when true, the user will NOT be able to do that thing)', 'object_chatBannedRights_param_view_messages_type_true' => 'Can view messages?', - 'object_chatBannedRights_param_send_messages_type_true' => 'Can send messages?', + 'object_chatBannedRights_param_sendMessages_type_true' => 'Can send messages?', 'object_chatBannedRights_param_send_media_type_true' => 'Can send media?', 'object_chatBannedRights_param_send_stickers_type_true' => 'Can send stickers?', 'object_chatBannedRights_param_send_gifs_type_true' => 'Can send gifs?', @@ -5136,7 +5136,7 @@ class Lang 'object_peerLocated_param_expires_type_int' => 'Expiry date', 'object_peerLocated_param_distance_type_int' => 'Distance', 'method_account.registerDevice_param_no_muted_type_true' => 'Idk yet', - 'method_upload.getFile_param_precise_type_true' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile_param_precise_type_true' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'method_channels.editAdmin_param_rank_type_string' => 'Admin rank, an arbitrary string', 'method_channels.toggleSlowMode' => 'Toggle slow mode', 'method_channels.toggleSlowMode_param_channel_type_InputChannel' => 'Supergroup', @@ -5272,7 +5272,7 @@ class Lang 'socket_status_5' => 'WORKING', 'api_not_set' => 'You must provide an api key and an api id, get your own @ my.telegram.org', 'session_corrupted' => 'The session is corrupted!', - 'reset_session_seqno' => 'Resetting session id and seq_no in DC %s...', + 'resetSession_seqno' => 'Resetting session id and seq_no in DC %s...', 'gen_perm_auth_key' => 'Generating permanent authorization key for DC %s...', 'gen_temp_auth_key' => 'Generating temporary authorization key for DC %s...', 'copy_auth_dcs' => 'Copying authorization from DC %s to DC %s...', @@ -5313,21 +5313,21 @@ class Lang 'madelineproto_ready' => 'MadelineProto is ready!', 'logout_error' => 'An error occurred while logging out!', 'logout_ok' => 'Logged out successfully!', - 'already_logged_in' => 'This instance of MadelineProto is already logged in. Logging out first...', + 'already_loggedIn' => 'This instance of MadelineProto is already logged in. Logging out first...', 'login_ok' => 'Logged in successfully!', 'login_user' => 'Logging in as a normal user...', 'login_bot' => 'Logging in as a bot...', 'login_code_sending' => 'Sending code...', - 'login_code_sent' => 'Code sent successfully! Once you receive the code you should use the complete_phone_login function.', - 'login_code_uncalled' => 'I\'m not waiting for the code! Please call the phone_login method first', + 'login_code_sent' => 'Code sent successfully! Once you receive the code you should use the completePhoneLogin function.', + 'login_code_uncalled' => 'I\'m not waiting for the code! Please call the phoneLogin method first', 'login_2fa_enabled' => '2FA enabled, you will have to call the complete_2fa_login function...', - 'login_need_signup' => 'An account has not been created for this number, you will have to call the complete_signup function...', + 'login_need_signup' => 'An account has not been created for this number, you will have to call the completeSignup function...', 'login_auth_key' => 'Logging in using auth key...', - 'not_logged_in' => 'I\'m not logged in!', - 'signup_uncalled' => 'I\'m not waiting to signup! Please call the phone_login and the complete_phone_login methods first!', + 'not_loggedIn' => 'I\'m not logged in!', + 'signup_uncalled' => 'I\'m not waiting to signup! Please call the phoneLogin and the completePhoneLogin methods first!', 'signing_up' => 'Signing up as a normal user...', 'signup_ok' => 'Signed up in successfully!', - '2fa_uncalled' => 'I\'m not waiting for the password! Please call the phone_login and the complete_phone_login methods first!', + '2fa_uncalled' => 'I\'m not waiting for the password! Please call the phoneLogin and the completePhoneLogin methods first!', 'getting_dialogs' => 'Getting dialogs...', 'libtgvoip_required' => 'The php-libtgvoip extension is required to accept and manage calls. See daniil.it/MadelineProto for more info.', 'peer_not_in_db' => 'This peer is not present in the internal peer database', @@ -5440,41 +5440,41 @@ class Lang 'method_invokeWithoutUpdates_param_query_type_!X' => 'The query', 'method_auth.checkPhone' => 'Check if this phone number is registered on telegram', 'method_auth.checkPhone_param_phone_number_type_string' => 'The phone number to check', - 'method_auth.sendCode' => 'Use phone_login instead', - 'method_auth.sendCode_param_allow_flashcall_type_true' => 'Use phone_login instead', - 'method_auth.sendCode_param_phone_number_type_string' => 'Use phone_login instead', - 'method_auth.sendCode_param_current_number_type_Bool' => 'Use phone_login instead', - 'method_auth.sendCode_param_api_id_type_int' => 'Use phone_login instead', - 'method_auth.sendCode_param_api_hash_type_string' => 'Use phone_login instead', - 'method_auth.signUp' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_phone_number_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_phone_code_hash_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_phone_code_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_first_name_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signUp_param_last_name_type_string' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signIn' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signIn_param_phone_number_type_string' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signIn_param_phone_code_hash_type_string' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.signIn_param_phone_code_type_string' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.sendCode' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_allow_flashcall_type_true' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_phone_number_type_string' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_current_number_type_Bool' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_api_id_type_int' => 'Use phoneLogin instead', + 'method_auth.sendCode_param_api_hash_type_string' => 'Use phoneLogin instead', + 'method_auth.signUp' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_phone_number_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_phone_code_hash_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_phone_code_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_first_name_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signUp_param_last_name_type_string' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signIn' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signIn_param_phone_number_type_string' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signIn_param_phone_code_hash_type_string' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.signIn_param_phone_code_type_string' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.logOut' => 'You cannot use this method directly, use the logout method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.resetAuthorizations' => 'Delete all logged-in sessions.', 'method_auth.sendInvites' => 'Invite friends to telegram!', 'method_auth.sendInvites_param_phone_numbers_type_Vector t' => 'Phone numbers to invite', 'method_auth.sendInvites_param_message_type_string' => 'The message to send', - 'method_auth.exportAuthorization' => 'You cannot use this method directly, use $MadelineProto->export_authorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', - 'method_auth.exportAuthorization_param_dc_id_type_int' => 'You cannot use this method directly, use $MadelineProto->export_authorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', - 'method_auth.importAuthorization' => 'You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', - 'method_auth.importAuthorization_param_id_type_int' => 'You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', - 'method_auth.importAuthorization_param_bytes_type_bytes' => 'You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.exportAuthorization' => 'You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.exportAuthorization_param_dc_id_type_int' => 'You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.importAuthorization' => 'You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.importAuthorization_param_id_type_int' => 'You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', + 'method_auth.importAuthorization_param_bytes_type_bytes' => 'You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', 'method_auth.bindTempAuthKey' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'method_auth.bindTempAuthKey_param_perm_auth_key_id_type_long' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'method_auth.bindTempAuthKey_param_nonce_type_long' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'method_auth.bindTempAuthKey_param_expires_at_type_int' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'method_auth.bindTempAuthKey_param_encrypted_message_type_bytes' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', - 'method_auth.importBotAuthorization' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_api_id_type_int' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_api_hash_type_string' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_bot_auth_token_type_string' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_api_id_type_int' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_api_hash_type_string' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_bot_auth_token_type_string' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.checkPassword' => 'You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.checkPassword_param_password_hash_type_bytes' => 'You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.requestPasswordRecovery' => 'Send an email to recover the 2FA password', @@ -5562,8 +5562,8 @@ class Lang 'method_account.resetWebAuthorizations' => 'Reset all telegram web login authorizations', 'method_users.getUsers' => 'Get info about users', 'method_users.getUsers_param_id_type_Vector t' => 'The ids of the users', - 'method_users.getFullUser' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', - 'method_users.getFullUser_param_id_type_InputUser' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_users.getFullUser' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_users.getFullUser_param_id_type_InputUser' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'method_contacts.getStatuses' => 'Get online status of all users', 'method_contacts.getContacts' => 'Get all contacts', 'method_contacts.getContacts_param_hash_type_int' => 'User ids of contacts previously fetched with this method', @@ -5586,8 +5586,8 @@ class Lang 'method_contacts.search' => 'Search contacts', 'method_contacts.search_param_q_type_string' => 'The search query', 'method_contacts.search_param_limit_type_int' => 'How many results should be returned', - 'method_contacts.resolveUsername' => 'You cannot use this method directly, use the resolve_username, get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', - 'method_contacts.resolveUsername_param_username_type_string' => 'You cannot use this method directly, use the resolve_username, get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_contacts.resolveUsername' => 'You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_contacts.resolveUsername_param_username_type_string' => 'You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'method_contacts.getTopPeers' => 'Get most used chats', 'method_contacts.getTopPeers_param_correspondents_type_true' => 'Fetch users?', 'method_contacts.getTopPeers_param_bots_pm_type_true' => 'Fetch bots?', @@ -5604,7 +5604,7 @@ class Lang 'method_contacts.resetSaved' => 'Reset saved contacts', 'method_messages.getMessages' => 'Get messages', 'method_messages.getMessages_param_id_type_Vector t' => 'The IDs of messages to fetch (only for users and normal groups)', - 'method_messages.getDialogs' => 'Gets list of chats: you should use $MadelineProto->get_dialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html', + 'method_messages.getDialogs' => 'Gets list of chats: you should use $MadelineProto->getDialogs() instead: https://docs.madelineproto.xyz/docs/DIALOGS.html', 'method_messages.getDialogs_param_exclude_pinned_type_true' => 'Do not fetch pinned chats', 'method_messages.getDialogs_param_offset_date_type_int' => 'End($res[\'messages\'])[\'date\'];', 'method_messages.getDialogs_param_offset_id_type_int' => 'End($res[\'messages\'])[\'id\'];', @@ -5682,8 +5682,8 @@ class Lang 'method_messages.getPeerSettings_param_peer_type_InputPeer' => 'The peer', 'method_messages.getChats' => 'Get info about chats', 'method_messages.getChats_param_id_type_Vector t' => 'The MTProto IDs of chats to fetch info about', - 'method_messages.getFullChat' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', - 'method_messages.getFullChat_param_chat_id_type_InputPeer' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_messages.getFullChat' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_messages.getFullChat_param_chat_id_type_InputPeer' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'method_messages.editChatTitle' => 'Edit the title of a normal chat (not supergroup)', 'method_messages.editChatTitle_param_chat_id_type_InputPeer' => 'The ID of the chat', 'method_messages.editChatTitle_param_title_type_string' => 'The new title', @@ -5700,9 +5700,9 @@ class Lang 'method_messages.createChat' => 'Create a chat (not supergroup)', 'method_messages.createChat_param_users_type_Vector t' => 'The users to add to the chat', 'method_messages.createChat_param_title_type_string' => 'The new chat\'s title', - 'method_messages.getDhConfig' => 'You cannot use this method directly, instead use $MadelineProto->get_dh_config();', - 'method_messages.getDhConfig_param_version_type_int' => 'You cannot use this method directly, instead use $MadelineProto->get_dh_config();', - 'method_messages.getDhConfig_param_random_length_type_int' => 'You cannot use this method directly, instead use $MadelineProto->get_dh_config();', + 'method_messages.getDhConfig' => 'You cannot use this method directly, instead use $MadelineProto->getDhConfig();', + 'method_messages.getDhConfig_param_version_type_int' => 'You cannot use this method directly, instead use $MadelineProto->getDhConfig();', + 'method_messages.getDhConfig_param_random_length_type_int' => 'You cannot use this method directly, instead use $MadelineProto->getDhConfig();', 'method_messages.requestEncryption' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'method_messages.requestEncryption_param_user_id_type_InputUser' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'method_messages.requestEncryption_param_g_a_type_bytes' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', @@ -5976,33 +5976,33 @@ class Lang 'method_photos.getUserPhotos_param_offset_type_int' => 'Offset', 'method_photos.getUserPhotos_param_max_id_type_long' => 'Maximum ID of photo to return', 'method_photos.getUserPhotos_param_limit_type_int' => 'Number of photos to return', - 'method_upload.saveFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveFilePart_param_file_id_type_long' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveFilePart_param_file_part_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveFilePart_param_bytes_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getFile_param_location_type_InputFileLocation' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getFile_param_offset_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getFile_param_limit_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart_param_file_id_type_long' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart_param_file_part_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart_param_file_total_parts_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.saveBigFilePart_param_bytes_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveFilePart' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveFilePart_param_file_id_type_long' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveFilePart_param_file_part_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveFilePart_param_bytes_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile_param_location_type_InputFileLocation' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile_param_offset_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile_param_limit_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart_param_file_id_type_long' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart_param_file_part_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart_param_file_total_parts_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.saveBigFilePart_param_bytes_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'method_upload.getWebFile' => 'Download a file through telegram', 'method_upload.getWebFile_param_location_type_InputWebFileLocation' => 'The file', 'method_upload.getWebFile_param_offset_type_int' => 'The offset in bytes', 'method_upload.getWebFile_param_limit_type_int' => 'The number of bytes to fetch', - 'method_upload.getCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFile_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFile_param_offset_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFile_param_limit_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.reuploadCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.reuploadCdnFile_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.reuploadCdnFile_param_request_token_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFileHashes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFileHashes_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', - 'method_upload.getCdnFileHashes_param_offset_type_int' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFile' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFile_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFile_param_offset_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFile_param_limit_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.reuploadCdnFile' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.reuploadCdnFile_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.reuploadCdnFile_param_request_token_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFileHashes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFileHashes_param_file_token_type_bytes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getCdnFileHashes_param_offset_type_int' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'method_help.getConfig' => 'Get server configuration', 'method_help.getNearestDc' => 'Get nearest datacenter', 'method_help.getAppUpdate' => 'Get info about app updates', @@ -6035,7 +6035,7 @@ class Lang 'method_channels.getMessages' => 'Get channel/supergroup messages', 'method_channels.getMessages_param_channel_type_InputChannel' => 'The channel/supergroup', 'method_channels.getMessages_param_id_type_Vector t' => 'The message IDs', - 'method_channels.getParticipants' => 'Get channel/supergroup participants (you should use `$MadelineProto->get_pwr_chat($id)` instead)', + 'method_channels.getParticipants' => 'Get channel/supergroup participants (you should use `$MadelineProto->getPwrChat($id)` instead)', 'method_channels.getParticipants_param_channel_type_InputChannel' => 'The channel', 'method_channels.getParticipants_param_filter_type_ChannelParticipantsFilter' => 'Member filter', 'method_channels.getParticipants_param_offset_type_int' => 'Offset', @@ -6046,8 +6046,8 @@ class Lang 'method_channels.getParticipant_param_user_id_type_InputUser' => 'The user to fetch info about', 'method_channels.getChannels' => 'Get info about multiple channels/supergroups', 'method_channels.getChannels_param_id_type_Vector t' => 'The channel/supergroup MTProto IDs', - 'method_channels.getFullChannel' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', - 'method_channels.getFullChannel_param_channel_type_InputChannel' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_channels.getFullChannel' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', + 'method_channels.getFullChannel_param_channel_type_InputChannel' => 'You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'method_channels.createChannel' => 'Create channel/supergroup', 'method_channels.createChannel_param_broadcast_type_true' => 'Set this to true to create a channel', 'method_channels.createChannel_param_megagroup_type_true' => 'Set this to true to create a supergroup', @@ -6195,8 +6195,8 @@ class Lang 'method_langpack.getDifference' => 'Get language pack updates', 'method_langpack.getDifference_param_from_version_type_int' => 'Previous version', 'method_langpack.getLanguages' => 'Get available languages', - 'method_auth.sendCode_param_sms_type_type_int' => 'You cannot use this method directly, use the phone_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.sendCode_param_lang_code_type_string' => 'You cannot use this method directly, use the phone_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.sendCode_param_sms_type_type_int' => 'You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.sendCode_param_lang_code_type_string' => 'You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info)', 'method_auth.sendCall' => 'Send verification phone call', 'method_auth.sendCall_param_phone_number_type_string' => 'The phone number', 'method_auth.sendCall_param_phone_code_hash_type_string' => 'The phone code hash', @@ -6357,10 +6357,10 @@ class Lang 'method_contest.saveDeveloperInfo_param_phone_number_type_string' => 'Phone number', 'method_contest.saveDeveloperInfo_param_age_type_int' => 'Age', 'method_contest.saveDeveloperInfo_param_city_type_string' => 'City', - 'method_auth.importBotAuthorization_param_a_type_true' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_b_type_true' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_c_type_true' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', - 'method_auth.importBotAuthorization_param_d_type_true' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_a_type_true' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_b_type_true' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_c_type_true' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.importBotAuthorization_param_d_type_true' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', 'object_vector' => 'Array', 'object_resPQ' => 'Contains pq to factorize', 'object_resPQ_param_nonce_type_int128' => 'Nonce', @@ -7956,23 +7956,23 @@ class Lang 'object_inputBotInlineResult_param_w_type_int' => 'Width', 'object_inputBotInlineResult_param_h_type_int' => 'Height', 'object_inputBotInlineResult_param_duration_type_int' => 'Duration', - 'object_inputBotInlineResult_param_send_message_type_InputBotInlineMessage' => 'Message to send', + 'object_inputBotInlineResult_param_sendMessage_type_InputBotInlineMessage' => 'Message to send', 'object_inputBotInlineResultPhoto' => 'Bot inline result photo', 'object_inputBotInlineResultPhoto_param_id_type_string' => 'ID', 'object_inputBotInlineResultPhoto_param_type_type_string' => 'Type', 'object_inputBotInlineResultPhoto_param_photo_type_InputPhoto' => 'Photo', - 'object_inputBotInlineResultPhoto_param_send_message_type_InputBotInlineMessage' => 'Message to send', + 'object_inputBotInlineResultPhoto_param_sendMessage_type_InputBotInlineMessage' => 'Message to send', 'object_inputBotInlineResultDocument' => 'Bot inline result document', 'object_inputBotInlineResultDocument_param_id_type_string' => 'ID', 'object_inputBotInlineResultDocument_param_type_type_string' => 'Type', 'object_inputBotInlineResultDocument_param_title_type_string' => 'Title', 'object_inputBotInlineResultDocument_param_description_type_string' => 'Description', 'object_inputBotInlineResultDocument_param_document_type_InputDocument' => 'Document', - 'object_inputBotInlineResultDocument_param_send_message_type_InputBotInlineMessage' => 'Message to send', + 'object_inputBotInlineResultDocument_param_sendMessage_type_InputBotInlineMessage' => 'Message to send', 'object_inputBotInlineResultGame' => 'Bot inline result game', 'object_inputBotInlineResultGame_param_id_type_string' => 'ID', 'object_inputBotInlineResultGame_param_short_name_type_string' => 'Short name', - 'object_inputBotInlineResultGame_param_send_message_type_InputBotInlineMessage' => 'Message to send', + 'object_inputBotInlineResultGame_param_sendMessage_type_InputBotInlineMessage' => 'Message to send', 'object_botInlineMessageMediaAuto' => 'Bot inline message media auto', 'object_botInlineMessageMediaAuto_param_message_type_string' => 'Message', 'object_botInlineMessageMediaAuto_param_entities_type_Vector t' => 'Entities', @@ -8010,7 +8010,7 @@ class Lang 'object_botInlineResult_param_w_type_int' => 'Width', 'object_botInlineResult_param_h_type_int' => 'Height', 'object_botInlineResult_param_duration_type_int' => 'Duration', - 'object_botInlineResult_param_send_message_type_BotInlineMessage' => 'Message to send', + 'object_botInlineResult_param_sendMessage_type_BotInlineMessage' => 'Message to send', 'object_botInlineMediaResult' => 'Bot inline media result', 'object_botInlineMediaResult_param_id_type_string' => 'ID', 'object_botInlineMediaResult_param_type_type_string' => 'Type', @@ -8018,7 +8018,7 @@ class Lang 'object_botInlineMediaResult_param_document_type_Document' => 'Document', 'object_botInlineMediaResult_param_title_type_string' => 'Title', 'object_botInlineMediaResult_param_description_type_string' => 'Description', - 'object_botInlineMediaResult_param_send_message_type_BotInlineMessage' => 'Send message', + 'object_botInlineMediaResult_param_sendMessage_type_BotInlineMessage' => 'Send message', 'object_messages.botResults' => 'Bot results', 'object_messages.botResults_param_gallery_type_true' => 'Gallery?', 'object_messages.botResults_param_query_id_type_long' => 'Query ID', @@ -8454,7 +8454,7 @@ class Lang 'object_channelAdminRights_param_add_admins_type_true' => 'Add other admins', 'object_channelBannedRights' => 'Banned user rights (when true, the user will NOT be able to do that thing)', 'object_channelBannedRights_param_view_messages_type_true' => 'Disallow viewing messages', - 'object_channelBannedRights_param_send_messages_type_true' => 'Disallow sending messages', + 'object_channelBannedRights_param_sendMessages_type_true' => 'Disallow sending messages', 'object_channelBannedRights_param_send_media_type_true' => 'Disallow sending media', 'object_channelBannedRights_param_send_stickers_type_true' => 'Disallow sending stickers', 'object_channelBannedRights_param_send_gifs_type_true' => 'Disallow sending gifs', @@ -9128,12 +9128,12 @@ class Lang 'object_botInlineMediaResultDocument_param_id_type_string' => 'ID', 'object_botInlineMediaResultDocument_param_type_type_string' => 'Type', 'object_botInlineMediaResultDocument_param_document_type_Document' => 'Document', - 'object_botInlineMediaResultDocument_param_send_message_type_BotInlineMessage' => 'Send message', + 'object_botInlineMediaResultDocument_param_sendMessage_type_BotInlineMessage' => 'Send message', 'object_botInlineMediaResultPhoto' => 'Bot inline media result photo', 'object_botInlineMediaResultPhoto_param_id_type_string' => 'ID', 'object_botInlineMediaResultPhoto_param_type_type_string' => 'Type', 'object_botInlineMediaResultPhoto_param_photo_type_Photo' => 'Photo', - 'object_botInlineMediaResultPhoto_param_send_message_type_BotInlineMessage' => 'Send message', + 'object_botInlineMediaResultPhoto_param_sendMessage_type_BotInlineMessage' => 'Send message', 'object_inputMediaVideo_param_video_type_InputVideo' => 'Video', 'object_inputMediaAudio_param_audio_type_InputAudio' => 'Audio', 'object_inputMediaDocument_param_document_id_type_InputDocument' => 'Document ID', @@ -9836,7 +9836,7 @@ class Lang 'object_chatOnlines_param_onlines_type_int' => 'Onlines', 'object_statsURL' => 'Stats URL', 'object_statsURL_param_url_type_string' => 'URL', - 'method_auth.sendCode_param_settings_type_CodeSettings' => 'You cannot use this method directly, use the phone_login method instead (see https://docs.madelineproto.xyz for more info)', + 'method_auth.sendCode_param_settings_type_CodeSettings' => 'You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info)', 'method_account.getWallPapers_param_hash_type_Vector t' => 'IDs of previously fetched wallpapers', 'method_account.sendChangePhoneCode_param_settings_type_CodeSettings' => 'Code settings', 'method_account.sendConfirmPhoneCode_param_settings_type_CodeSettings' => 'Code settings', @@ -9910,7 +9910,7 @@ class Lang 'object_chatAdminRights_param_add_admins_type_true' => 'Can add other admins?', 'object_chatBannedRights' => 'Banned rights (when true, the user will NOT be able to do that thing)', 'object_chatBannedRights_param_view_messages_type_true' => 'Can view messages?', - 'object_chatBannedRights_param_send_messages_type_true' => 'Can send messages?', + 'object_chatBannedRights_param_sendMessages_type_true' => 'Can send messages?', 'object_chatBannedRights_param_send_media_type_true' => 'Can send media?', 'object_chatBannedRights_param_send_stickers_type_true' => 'Can send stickers?', 'object_chatBannedRights_param_send_gifs_type_true' => 'Can send gifs?', @@ -10221,7 +10221,7 @@ class Lang 'object_peerLocated_param_expires_type_int' => 'Expiry date', 'object_peerLocated_param_distance_type_int' => 'Distance', 'method_account.registerDevice_param_no_muted_type_true' => 'Idk yet', - 'method_upload.getFile_param_precise_type_true' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', + 'method_upload.getFile_param_precise_type_true' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'method_channels.editAdmin_param_rank_type_string' => 'Admin rank, an arbitrary string', 'method_channels.toggleSlowMode' => 'Toggle slow mode', 'method_channels.toggleSlowMode_param_channel_type_InputChannel' => 'Supergroup', diff --git a/src/danog/MadelineProto/Loop/Connection/HttpWaitLoop.php b/src/danog/MadelineProto/Loop/Connection/HttpWaitLoop.php index 5005569c..12a0c58f 100644 --- a/src/danog/MadelineProto/Loop/Connection/HttpWaitLoop.php +++ b/src/danog/MadelineProto/Loop/Connection/HttpWaitLoop.php @@ -81,7 +81,7 @@ class HttpWaitLoop extends ResumableSignalLoop } $API->logger->logger("DC $datacenter: request {$connection->countHttpSent()}, response {$connection->countHttpReceived()}"); if ($connection->countHttpSent() === $connection->countHttpReceived() && (!empty($connection->pending_outgoing) || (!empty($connection->new_outgoing) && !$connection->hasPendingCalls()))) { - yield $connection->sendMessage(['_' => 'http_wait', 'body' => ['max_wait' => 30000, 'wait_after' => 0, 'max_delay' => 0], 'content_related' => true, 'unencrypted' => false, 'method' => false]); + yield $connection->sendMessage(['_' => 'http_wait', 'body' => ['max_wait' => 30000, 'wait_after' => 0, 'max_delay' => 0], 'contentRelated' => true, 'unencrypted' => false, 'method' => false]); } $API->logger->logger("DC $datacenter: request {$connection->countHttpSent()}, response {$connection->countHttpReceived()}"); } diff --git a/src/danog/MadelineProto/Loop/Connection/ReadLoop.php b/src/danog/MadelineProto/Loop/Connection/ReadLoop.php index 70e826d0..215851c2 100644 --- a/src/danog/MadelineProto/Loop/Connection/ReadLoop.php +++ b/src/danog/MadelineProto/Loop/Connection/ReadLoop.php @@ -127,7 +127,7 @@ class ReadLoop extends SignalLoop $connection->httpReceived(); - Loop::defer([$connection, 'handle_messages']); + Loop::defer([$connection, 'handleMessages']); if ($shared->isHttp()) { Loop::defer([$connection, 'pingHttpWaiter']); diff --git a/src/danog/MadelineProto/Loop/Connection/WriteLoop.php b/src/danog/MadelineProto/Loop/Connection/WriteLoop.php index 2d14a3fc..7c1d21a7 100644 --- a/src/danog/MadelineProto/Loop/Connection/WriteLoop.php +++ b/src/danog/MadelineProto/Loop/Connection/WriteLoop.php @@ -182,7 +182,7 @@ class WriteLoop extends ResumableSignalLoop $temporary_keys = []; if (\count($to_ack = $connection->ack_queue)) { foreach (\array_chunk($connection->ack_queue, 8192) as $acks) { - $connection->pending_outgoing[$connection->pending_outgoing_key] = ['_' => 'msgs_ack', 'serialized_body' => yield $this->API->serializeObject(['type' => 'msgs_ack'], ['msg_ids' => $acks], 'msgs_ack'), 'content_related' => false, 'unencrypted' => false, 'method' => false]; + $connection->pending_outgoing[$connection->pending_outgoing_key] = ['_' => 'msgs_ack', 'serialized_body' => yield $this->API->serializeObject(['type' => 'msgs_ack'], ['msg_ids' => $acks], 'msgs_ack'), 'contentRelated' => false, 'unencrypted' => false, 'method' => false]; $temporary_keys[$connection->pending_outgoing_key] = true; $API->logger->logger("Adding msgs_ack {$connection->pending_outgoing_key}", Logger::ULTRA_VERBOSE); $connection->pending_outgoing_key++; @@ -200,7 +200,7 @@ class WriteLoop extends ResumableSignalLoop } if ($shared->isHttp() && !$has_http_wait) { $API->logger->logger("Adding http_wait {$connection->pending_outgoing_key}", Logger::ULTRA_VERBOSE); - $connection->pending_outgoing[$connection->pending_outgoing_key] = ['_' => 'http_wait', 'serialized_body' => yield $this->API->serializeObject(['type' => ''], ['_' => 'http_wait', 'max_wait' => 30000, 'wait_after' => 0, 'max_delay' => 0], 'http_wait'), 'content_related' => true, 'unencrypted' => false, 'method' => true]; + $connection->pending_outgoing[$connection->pending_outgoing_key] = ['_' => 'http_wait', 'serialized_body' => yield $this->API->serializeObject(['type' => ''], ['_' => 'http_wait', 'max_wait' => 30000, 'wait_after' => 0, 'max_delay' => 0], 'http_wait'), 'contentRelated' => true, 'unencrypted' => false, 'method' => true]; $temporary_keys[$connection->pending_outgoing_key] = true; $connection->pending_outgoing_key++; } @@ -234,7 +234,7 @@ class WriteLoop extends ResumableSignalLoop $API->logger->logger("Sending {$message['_']} as encrypted message to DC {$datacenter}", \danog\MadelineProto\Logger::ULTRA_VERBOSE); - $MTmessage = ['_' => 'MTmessage', 'msg_id' => $message_id, 'body' => $message['serialized_body'], 'seqno' => $connection->generateOutSeqNo($message['content_related'])]; + $MTmessage = ['_' => 'MTmessage', 'msg_id' => $message_id, 'body' => $message['serialized_body'], 'seqno' => $connection->generateOutSeqNo($message['contentRelated'])]; if (isset($message['method']) && $message['method'] && $message['_'] !== 'http_wait') { if (!$shared->getTempAuthKey()->isInited() && $message['_'] !== 'auth.bindTempAuthKey' && !$inited) { @@ -312,7 +312,7 @@ class WriteLoop extends ResumableSignalLoop $API->logger->logger("Wrapping in msg_container ($count messages of total size $total_length) as encrypted message for DC {$datacenter}", \danog\MadelineProto\Logger::ULTRA_VERBOSE); $message_id = $connection->generateMessageId(); - $connection->pending_outgoing[$connection->pending_outgoing_key] = ['_' => 'msg_container', 'container' => \array_values($keys), 'content_related' => false, 'method' => false, 'unencrypted' => false]; + $connection->pending_outgoing[$connection->pending_outgoing_key] = ['_' => 'msg_container', 'container' => \array_values($keys), 'contentRelated' => false, 'method' => false, 'unencrypted' => false]; //var_dumP("container ".bin2hex($message_id)); $keys[$connection->pending_outgoing_key++] = $message_id; diff --git a/src/danog/MadelineProto/Loop/Update/FeedLoop.php b/src/danog/MadelineProto/Loop/Update/FeedLoop.php index 6c8050a3..b8bee9e0 100644 --- a/src/danog/MadelineProto/Loop/Update/FeedLoop.php +++ b/src/danog/MadelineProto/Loop/Update/FeedLoop.php @@ -50,11 +50,11 @@ class FeedLoop extends ResumableSignalLoop $API = $this->API; $this->updater = $API->updaters[$this->channelId]; - if (!$this->API->settings['updates']['handle_updates']) { + if (!$this->API->settings['updates']['handleUpdates']) { return false; } - while (!$this->API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { + while (!$this->API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { return; } @@ -62,7 +62,7 @@ class FeedLoop extends ResumableSignalLoop $this->state = $this->channelId === false ? (yield $API->loadUpdateState()) : $API->loadChannelState($this->channelId); while (true) { - while (!$this->API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { + while (!$this->API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { return; } @@ -70,7 +70,7 @@ class FeedLoop extends ResumableSignalLoop if (yield $this->waitSignal($this->pause())) { return; } - if (!$this->API->settings['updates']['handle_updates']) { + if (!$this->API->settings['updates']['handleUpdates']) { return; } $API->logger->logger("Resumed $this"); diff --git a/src/danog/MadelineProto/Loop/Update/SeqLoop.php b/src/danog/MadelineProto/Loop/Update/SeqLoop.php index 85a960dc..cbc15c06 100644 --- a/src/danog/MadelineProto/Loop/Update/SeqLoop.php +++ b/src/danog/MadelineProto/Loop/Update/SeqLoop.php @@ -42,11 +42,11 @@ class SeqLoop extends ResumableSignalLoop $API = $this->API; $this->feeder = $API->feeders[false]; - if (!$this->API->settings['updates']['handle_updates']) { + if (!$this->API->settings['updates']['handleUpdates']) { return false; } - while (!$this->API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { + while (!$this->API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { return; } @@ -54,7 +54,7 @@ class SeqLoop extends ResumableSignalLoop $this->state = yield $API->loadUpdateState(); while (true) { - while (!$this->API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { + while (!$this->API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { return; } @@ -62,7 +62,7 @@ class SeqLoop extends ResumableSignalLoop if (yield $this->waitSignal($this->pause())) { return; } - if (!$this->API->settings['updates']['handle_updates']) { + if (!$this->API->settings['updates']['handleUpdates']) { return; } while ($this->incomingUpdates) { diff --git a/src/danog/MadelineProto/Loop/Update/UpdateLoop.php b/src/danog/MadelineProto/Loop/Update/UpdateLoop.php index 600cd68b..449e16d9 100644 --- a/src/danog/MadelineProto/Loop/Update/UpdateLoop.php +++ b/src/danog/MadelineProto/Loop/Update/UpdateLoop.php @@ -47,7 +47,7 @@ class UpdateLoop extends ResumableSignalLoop $API = $this->API; $feeder = $this->feeder = $API->feeders[$this->channelId]; - while (!$API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { + while (!$API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { $API->logger->logger("Exiting $this due to signal"); @@ -59,7 +59,7 @@ class UpdateLoop extends ResumableSignalLoop $timeout = $API->settings['updates']['getdifference_interval']; $first = true; while (true) { - while (!$API->settings['updates']['handle_updates'] || !$API->hasAllAuth()) { + while (!$API->settings['updates']['handleUpdates'] || !$API->hasAllAuth()) { if (yield $this->waitSignal($this->pause())) { $API->logger->logger("Exiting $this due to signal"); diff --git a/src/danog/MadelineProto/Lua.php b/src/danog/MadelineProto/Lua.php index 8f21efa0..e6880606 100644 --- a/src/danog/MadelineProto/Lua.php +++ b/src/danog/MadelineProto/Lua.php @@ -32,7 +32,7 @@ class Lua throw new Exception(\danog\MadelineProto\Lang::$current_lang['script_not_exist']); } $this->MadelineProto = $MadelineProto; - $this->MadelineProto->settings['updates']['handle_updates'] = true; + $this->MadelineProto->settings['updates']['handleUpdates'] = true; $this->MadelineProto->API->datacenter->sockets[$this->MadelineProto->settings['connection_settings']['default_dc']]->startUpdateLoop(); $this->script = $script; @@ -48,8 +48,8 @@ class Lua { $this->Lua = new \Lua($this->script); $this->madelineproto_lua = 1; - $this->Lua->registerCallback('tdcli_function', [$this, 'tdcli_function']); - $this->Lua->registerCallback('madeline_function', [$this, 'madeline_function']); + $this->Lua->registerCallback('tdcliFunction', [$this, 'tdcliFunction']); + $this->Lua->registerCallback('madelineFunction', [$this, 'madelineFunction']); $this->Lua->registerCallback('var_dump', 'var_dump'); foreach (\get_class_methods($this->MadelineProto->API) as $method) { $this->Lua->registerCallback($method, [$this->MadelineProto, $method]); diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 4607a651..d0d8c885 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -125,7 +125,7 @@ class MTProto extends AsyncConstruct implements TLCallback * * @var array */ - const DISALLOWED_METHODS = ['account.updatePasswordSettings' => '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)', 'messages.receivedQueue' => 'You cannot use this method directly', 'messages.getDhConfig' => 'You cannot use this method directly, instead use $MadelineProto->get_dh_config();', 'auth.bindTempAuthKey' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'auth.exportAuthorization' => 'You cannot use this method directly, use $MadelineProto->export_authorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', 'auth.importAuthorization' => 'You cannot use this method directly, use $MadelineProto->import_authorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', 'auth.logOut' => 'You cannot use this method directly, use the logout method instead (see https://docs.madelineproto.xyz for more info)', 'auth.importBotAuthorization' => 'You cannot use this method directly, use the bot_login method instead (see https://docs.madelineproto.xyz for more info)', 'auth.sendCode' => 'You cannot use this method directly, use the phone_login method instead (see https://docs.madelineproto.xyz for more info)', 'auth.signIn' => 'You cannot use this method directly, use the complete_phone_login method instead (see https://docs.madelineproto.xyz for more info)', 'auth.checkPassword' => 'You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info)', 'auth.signUp' => 'You cannot use this method directly, use the complete_signup method instead (see https://docs.madelineproto.xyz for more info)', 'users.getFullUser' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', 'channels.getFullChannel' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', 'messages.getFullChat' => 'You cannot use this method directly, use the get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', 'contacts.resolveUsername' => 'You cannot use this method directly, use the resolve_username, get_pwr_chat, get_info, get_full_info methods instead (see https://docs.madelineproto.xyz for more info)', 'messages.acceptEncryption' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'messages.discardEncryption' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'messages.requestEncryption' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'phone.requestCall' => 'You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls', 'phone.acceptCall' => 'You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls', 'phone.confirmCall' => 'You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls', 'phone.discardCall' => 'You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls', 'updates.getChannelDifference' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates', 'updates.getDifference' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates', 'updates.getState' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates', 'upload.getCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.getFileHashes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.getCdnFileHashes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.reuploadCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.getFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.saveFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.saveBigFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info']; + const DISALLOWED_METHODS = ['account.updatePasswordSettings' => '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)', 'messages.receivedQueue' => 'You cannot use this method directly', 'messages.getDhConfig' => 'You cannot use this method directly, instead use $MadelineProto->getDhConfig();', 'auth.bindTempAuthKey' => 'You cannot use this method directly, instead modify the PFS and default_temp_auth_key_expires_in settings, see https://docs.madelineproto.xyz/docs/SETTINGS.html for more info', 'auth.exportAuthorization' => 'You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', 'auth.importAuthorization' => 'You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html', 'auth.logOut' => 'You cannot use this method directly, use the logout method instead (see https://docs.madelineproto.xyz for more info)', 'auth.importBotAuthorization' => 'You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info)', 'auth.sendCode' => 'You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info)', 'auth.signIn' => 'You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info)', 'auth.checkPassword' => 'You cannot use this method directly, use the complete_2fa_login method instead (see https://docs.madelineproto.xyz for more info)', 'auth.signUp' => 'You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info)', 'users.getFullUser' => '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)', 'contacts.resolveUsername' => 'You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info)', 'messages.acceptEncryption' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'messages.discardEncryption' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'messages.requestEncryption' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats', 'phone.requestCall' => 'You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls', 'phone.acceptCall' => 'You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls', 'phone.confirmCall' => 'You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls', 'phone.discardCall' => 'You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls', 'updates.getChannelDifference' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates', 'updates.getDifference' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates', 'updates.getState' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates', 'upload.getCdnFile' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.getFileHashes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.getCdnFileHashes' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.reuploadCdnFile' => 'You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info', 'upload.getFile' => '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, 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']; /** * Bad message error codes. * @@ -593,13 +593,13 @@ class MTProto extends AsyncConstruct implements TLCallback $this->serializeLoop = new PeriodicLoop($this, [$this, 'serialize'], 'serialize', $this->settings['serialization']['serialization_interval']); } if (!$this->phoneConfigLoop) { - $this->phoneConfigLoop = new PeriodicLoop($this, [$this, 'get_phone_config_async'], 'phone config', 24 * 3600); + $this->phoneConfigLoop = new PeriodicLoop($this, [$this, 'getPhoneConfig'], 'phone config', 24 * 3600); } if (!$this->checkTosLoop) { - $this->checkTosLoop = new PeriodicLoop($this, [$this, 'check_tos_async'], 'TOS', 24 * 3600); + $this->checkTosLoop = new PeriodicLoop($this, [$this, 'checkTos'], 'TOS', 24 * 3600); } if (!$this->configLoop) { - $this->configLoop = new PeriodicLoop($this, [$this, 'get_config_async'], 'config', 24 * 3600); + $this->configLoop = new PeriodicLoop($this, [$this, 'getConfig'], 'config', 24 * 3600); } $this->callCheckerLoop->start(); @@ -662,8 +662,8 @@ class MTProto extends AsyncConstruct implements TLCallback $this->updateCallbacks($callbacks); $this->settings['connection_settings']['all']['ipv6'] = \danog\MadelineProto\Magic::$ipv6; - /*if (isset($this->settings['pwr']['update_handler']) && $this->settings['pwr']['update_handler'] === $this->settings['updates']['callback']) { - unset($this->settings['pwr']['update_handler']); + /*if (isset($this->settings['pwr']['updateHandler']) && $this->settings['pwr']['updateHandler'] === $this->settings['updates']['callback']) { + unset($this->settings['pwr']['updateHandler']); $this->updates = []; }*/ /*$keys = array_keys((array) get_object_vars($this)); @@ -715,7 +715,7 @@ class MTProto extends AsyncConstruct implements TLCallback } $settings = $this->settings; if (isset($settings['updates']['callback'][0]) && $settings['updates']['callback'][0] === $this) { - $settings['updates']['callback'] = 'get_updates_update_handler'; + $settings['updates']['callback'] = 'getUpdatesUpdateHandler'; } if (isset($settings['updates']['getdifference_interval']) && $settings['updates']['getdifference_interval'] === -1) { unset($settings['updates']['getdifference_interval']); @@ -816,7 +816,7 @@ class MTProto extends AsyncConstruct implements TLCallback if ($this->authorized === self::LOGGED_IN && !$this->authorization['user']['bot'] && $this->settings['peer']['cache_all_peers_on_startup']) { yield $this->getDialogs($force); } - if ($this->authorized === self::LOGGED_IN && $this->settings['updates']['handle_updates']) { + if ($this->authorized === self::LOGGED_IN && $this->settings['updates']['handleUpdates']) { $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['getupdates_deserialization'], Logger::NOTICE); yield $this->updaters[false]->resume(); } @@ -1113,13 +1113,13 @@ class MTProto extends AsyncConstruct implements TLCallback // Should madeline fetch the full member list of every group it meets? 'cache_all_peers_on_startup' => false, ], 'requests' => ['gzip_encode_if_gt' => 1024 * 1024], 'updates' => [ - 'handle_updates' => false, + 'handleUpdates' => false, // Should I handle updates? 'handle_old_updates' => true, // Should I handle old updates on startup? 'getdifference_interval' => 10, // Getdifference manual polling interval - 'callback' => 'get_updates_update_handler', + 'callback' => 'getUpdatesUpdateHandler', // Update callback 'run_callback' => true, ], 'secret_chats' => ['accept_chats' => true], 'serialization' => [ @@ -1182,7 +1182,7 @@ class MTProto extends AsyncConstruct implements TLCallback throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['api_not_set'], 0, null, 'MadelineProto', 1); } $this->settings = $settings; - if (!$this->settings['updates']['handle_updates']) { + if (!$this->settings['updates']['handleUpdates']) { $this->updates = []; } // Setup logger @@ -1480,9 +1480,9 @@ class MTProto extends AsyncConstruct implements TLCallback public function getConstructorCallbacks(): array { return \array_merge( - \array_fill_keys(['chat', 'chatEmpty', 'chatForbidden', 'channel', 'channelEmpty', 'channelForbidden'], [[$this, 'add_chat_async']]), - \array_fill_keys(['user', 'userEmpty'], [[$this, 'add_user']]), - ['help.support' => [[$this, 'add_support']]] + \array_fill_keys(['chat', 'chatEmpty', 'chatForbidden', 'channel', 'channelEmpty', 'channelForbidden'], [[$this, 'addChat']]), + \array_fill_keys(['user', 'userEmpty'], [[$this, 'addUser']]), + ['help.support' => [[$this, 'addSupport']]] ); } @@ -1499,9 +1499,9 @@ class MTProto extends AsyncConstruct implements TLCallback public function getTypeMismatchCallbacks(): array { return \array_merge( - \array_fill_keys(['User', 'InputUser', 'Chat', 'InputChannel', 'Peer', 'InputPeer', 'InputDialogPeer', 'InputNotifyPeer'], [$this, 'get_info_async']), - \array_fill_keys(['InputMedia', 'InputDocument', 'InputPhoto'], [$this, 'get_file_info_async']), - \array_fill_keys(['InputFileLocation'], [$this, 'get_download_info_async']) + \array_fill_keys(['User', 'InputUser', 'Chat', 'InputChannel', 'Peer', 'InputPeer', 'InputDialogPeer', 'InputNotifyPeer'], [$this, 'getInfo']), + \array_fill_keys(['InputMedia', 'InputDocument', 'InputPhoto'], [$this, 'getFileInfo']), + \array_fill_keys(['InputFileLocation'], [$this, 'getDownloadInfo']) ); } diff --git a/src/danog/MadelineProto/MTProtoSession/CallHandler.php b/src/danog/MadelineProto/MTProtoSession/CallHandler.php index 9f847610..bfe4c45f 100644 --- a/src/danog/MadelineProto/MTProtoSession/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoSession/CallHandler.php @@ -190,7 +190,7 @@ trait CallHandler [ '_' => $method, 'type' => $this->API->methods->findByMethod($method)['type'], - 'content_related' => $this->contentRelated($method), + 'contentRelated' => $this->contentRelated($method), 'promise' => $deferred, 'method' => true, 'unencrypted' => !$this->shared->hasTempAuthKey() && \strpos($method, '.') === false @@ -225,7 +225,7 @@ trait CallHandler */ public function objectCall(string $object, $args = [], array $aargs = ['msg_id' => null]): \Generator { - $message = ['_' => $object, 'body' => $args, 'content_related' => $this->contentRelated($object), 'unencrypted' => !$this->shared->hasTempAuthKey(), 'method' => false]; + $message = ['_' => $object, 'body' => $args, 'contentRelated' => $this->contentRelated($object), 'unencrypted' => !$this->shared->hasTempAuthKey(), 'method' => false]; if (isset($aargs['promise'])) { $message['promise'] = $aargs['promise']; } diff --git a/src/danog/MadelineProto/MTProtoSession/ResponseHandler.php b/src/danog/MadelineProto/MTProtoSession/ResponseHandler.php index 8a2dc521..a61dffb7 100644 --- a/src/danog/MadelineProto/MTProtoSession/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoSession/ResponseHandler.php @@ -370,7 +370,7 @@ trait ResponseHandler if (\strpos($response['error_message'], 'FILE_REFERENCE_') === 0) { $this->logger->logger("Got {$response['error_message']}, refreshing file reference and repeating method call..."); - $request['refresh_references'] = true; + $request['refreshReferences'] = true; if (isset($request['serialized_body'])) { unset($request['serialized_body']); } @@ -389,7 +389,7 @@ trait ResponseHandler return; } if (\in_array($response['error_message'], ['MSGID_DECREASE_RETRY', 'RPC_CALL_FAIL', 'PERSISTENT_TIMESTAMP_OUTDATED', 'RPC_MCGET_FAIL', 'no workers running'])) { - Loop::delay(1 * 1000, [$this, 'method_recall'], ['message_id' => $request_id, ]); + Loop::delay(1 * 1000, [$this, 'methodRecall'], ['message_id' => $request_id, ]); return; } $this->gotResponseForOutgoingMessageId($request_id); @@ -408,7 +408,7 @@ trait ResponseHandler if (isset($request['user_related']) && $request['user_related']) { $this->API->settings['connection_settings']['default_dc'] = $this->API->authorized_dc = $this->API->datacenter->curdc; } - Loop::defer([$this, 'method_recall'], ['message_id' => $request_id, 'datacenter' => $datacenter]); + Loop::defer([$this, 'methodRecall'], ['message_id' => $request_id, 'datacenter' => $datacenter]); //$this->API->methodRecall('', ['message_id' => $request_id, 'datacenter' => $datacenter, 'postpone' => true]); return; @@ -522,7 +522,7 @@ trait ResponseHandler $this->logger->logger('Flood, waiting '.$seconds.' seconds before repeating async call...', \danog\MadelineProto\Logger::NOTICE); $request['sent'] += $seconds; - Loop::delay($seconds * 1000, [$this, 'method_recall'], ['message_id' => $request_id, ]); + Loop::delay($seconds * 1000, [$this, 'methodRecall'], ['message_id' => $request_id, ]); return; } diff --git a/src/danog/MadelineProto/MTProtoSession/SeqNoHandler.php b/src/danog/MadelineProto/MTProtoSession/SeqNoHandler.php index b419d7de..ca564b75 100644 --- a/src/danog/MadelineProto/MTProtoSession/SeqNoHandler.php +++ b/src/danog/MadelineProto/MTProtoSession/SeqNoHandler.php @@ -31,9 +31,9 @@ trait SeqNoHandler public $session_id; - public function generateOutSeqNo($content_related) + public function generateOutSeqNo($contentRelated) { - $in = $content_related ? 1 : 0; + $in = $contentRelated ? 1 : 0; $value = $this->session_out_seq_no; $this->session_out_seq_no += $in; //$this->API->logger->logger("OUT: $value + $in = ".$this->session_out_seq_no); @@ -50,9 +50,9 @@ trait SeqNoHandler } } - public function generateInSeqNo($content_related) + public function generateInSeqNo($contentRelated) { - $in = $content_related ? 1 : 0; + $in = $contentRelated ? 1 : 0; $value = $this->session_in_seq_no; $this->session_in_seq_no += $in; //$this->API->logger->logger("IN: $value + $in = ".$this->session_in_seq_no); diff --git a/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php b/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php index b05c4050..c543ff17 100644 --- a/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php @@ -550,7 +550,7 @@ trait AuthKeyHandler $temp_auth_key_id = $datacenterConnection->getTempAuthKey()->getID(); $perm_auth_key_id = $datacenterConnection->getPermAuthKey()->getID(); $temp_session_id = $connection->session_id; - $message_data = yield $this->serializeObject(['type' => 'bind_auth_key_inner'], ['nonce' => $nonce, 'temp_auth_key_id' => $temp_auth_key_id, 'perm_auth_key_id' => $perm_auth_key_id, 'temp_session_id' => $temp_session_id, 'expires_at' => $expires_at], 'bind_temp_auth_key_inner'); + $message_data = yield $this->serializeObject(['type' => 'bind_auth_key_inner'], ['nonce' => $nonce, 'temp_auth_key_id' => $temp_auth_key_id, 'perm_auth_key_id' => $perm_auth_key_id, 'temp_session_id' => $temp_session_id, 'expires_at' => $expires_at], 'bindTempAuthKey_inner'); $message_id = $connection->generateMessageId(); $seq_no = 0; $encrypted_data = $this->random(16).$message_id.\pack('VV', $seq_no, \strlen($message_data)).$message_data; diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index 452658f0..296e2e3e 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -27,7 +27,7 @@ use Amp\Promise; trait CallHandler { /** - * Synchronous wrapper for method_call. + * Synchronous wrapper for methodCall. * * @param string $method Method name * @param array $args Arguments diff --git a/src/danog/MadelineProto/MTProtoTools/Files.php b/src/danog/MadelineProto/MTProtoTools/Files.php index 4ac8699e..b9488b4b 100644 --- a/src/danog/MadelineProto/MTProtoTools/Files.php +++ b/src/danog/MadelineProto/MTProtoTools/Files.php @@ -807,15 +807,15 @@ trait Files header('Content-Transfer-Encoding: Binary'); header('Accept-Ranges: bytes'); //header('Content-disposition: attachment: filename="'.basename($select['file_path']).'"'); - $MadelineProto->download_to_stream($select['file_id'], fopen('php://output', 'w'), function ($percent) { + $MadelineProto->downloadToStream($select['file_id'], fopen('php://output', 'w'), function ($percent) { flush(); ob_flush(); \danog\MadelineProto\Logger::log('Download status: '.$percent.'%'); }, $seek_start, $seek_end + 1); - //analytics(true, $file_path, $MadelineProto->get_self()['id'], $dbuser, $dbpassword); + //analytics(true, $file_path, $MadelineProto->getSelf()['id'], $dbuser, $dbpassword); $MadelineProto->API->getting_state = false; $MadelineProto->API->storeDb([], true); - $MadelineProto->API->reset_session(); + $MadelineProto->API->resetSession(); } else { if ($seek_start > 0 || $seek_end < $select['file_size'] - 1) { header('HTTP/1.1 206 Partial Content'); diff --git a/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php b/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php index 9b8f9391..4814eefe 100644 --- a/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php +++ b/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php @@ -496,7 +496,7 @@ class ReferenceDatabase implements TLCallback if (isset($this->API->full_chats[$origin['peer']]['last_update'])) { $this->API->full_chats[$origin['peer']]['last_update'] = 0; } - $this->API->get_full_info($origin['peer']); + $this->API->getFullInfo($origin['peer']); break; // Peer (default photo ID) case self::USER_PHOTO_ORIGIN: diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index b7e6f25e..3c6b69d4 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -35,20 +35,20 @@ trait UpdateHandler public function pwrUpdateHandler($update) { - if (isset($this->settings['pwr']['update_handler'])) { - if (\is_array($this->settings['pwr']['update_handler']) && $this->settings['pwr']['update_handler'][0] === false) { - $this->settings['pwr']['update_handler'] = $this->settings['pwr']['update_handler'][1]; + if (isset($this->settings['pwr']['updateHandler'])) { + if (\is_array($this->settings['pwr']['updateHandler']) && $this->settings['pwr']['updateHandler'][0] === false) { + $this->settings['pwr']['updateHandler'] = $this->settings['pwr']['updateHandler'][1]; } - if (\is_string($this->settings['pwr']['update_handler'])) { - return $this->{$this->settings['pwr']['update_handler']}($update); + if (\is_string($this->settings['pwr']['updateHandler'])) { + return $this->{$this->settings['pwr']['updateHandler']}($update); } - \in_array($this->settings['pwr']['update_handler'], [['danog\\MadelineProto\\API', 'get_updates_update_handler'], 'get_updates_update_handler']) ? $this->getUpdatesUpdateHandler($update) : $this->settings['pwr']['update_handler']($update); + \in_array($this->settings['pwr']['updateHandler'], [['danog\\MadelineProto\\API', 'getUpdatesUpdateHandler'], 'getUpdatesUpdateHandler']) ? $this->getUpdatesUpdateHandler($update) : $this->settings['pwr']['updateHandler']($update); } } public function getUpdatesUpdateHandler($update) { - if (!$this->settings['updates']['handle_updates']) { + if (!$this->settings['updates']['handleUpdates']) { return; } $this->updates[$this->updates_key++] = $update; @@ -56,8 +56,8 @@ trait UpdateHandler public function getUpdates($params = []) { - if (!$this->settings['updates']['handle_updates']) { - $this->settings['updates']['handle_updates'] = true; + if (!$this->settings['updates']['handleUpdates']) { + $this->settings['updates']['handleUpdates'] = true; $this->startUpdateSystem(); } if (!$this->settings['updates']['run_callback']) { @@ -173,7 +173,7 @@ trait UpdateHandler public function handleUpdates($updates, $actual_updates = null) { - if (!$this->settings['updates']['handle_updates']) { + if (!$this->settings['updates']['handleUpdates']) { return; } if ($actual_updates) { @@ -365,7 +365,7 @@ trait UpdateHandler //if ($update['_'] === 'updateServiceNotification' && strpos($update['type'], 'AUTH_KEY_DROP_') === 0) { //} - if (!$this->settings['updates']['handle_updates']) { + if (!$this->settings['updates']['handleUpdates']) { return; } if (isset($update['message']['_']) && $update['message']['_'] === 'messageEmpty') { @@ -375,7 +375,7 @@ trait UpdateHandler $update['message']['out'] = true; } //$this->logger->logger('Saving an update of type '.$update['_'].'...', \danog\MadelineProto\Logger::ULTRA_VERBOSE); - if (isset($this->settings['pwr']['strict']) && $this->settings['pwr']['strict'] && isset($this->settings['pwr']['update_handler'])) { + if (isset($this->settings['pwr']['strict']) && $this->settings['pwr']['strict'] && isset($this->settings['pwr']['updateHandler'])) { $this->pwrUpdateHandler($update); } elseif ($this->settings['updates']['run_callback']) { $this->getUpdatesUpdateHandler($update); diff --git a/src/danog/MadelineProto/Magic.php b/src/danog/MadelineProto/Magic.php index e9554aab..5e14ade7 100644 --- a/src/danog/MadelineProto/Magic.php +++ b/src/danog/MadelineProto/Magic.php @@ -38,7 +38,7 @@ class Magic public static $BIG_ENDIAN = false; public static $bigint = true; public static $isatty = false; - public static $is_fork = false; + public static $isFork = false; public static $can_getmypid = true; public static $can_parallel = false; public static $can_getcwd = false; @@ -76,7 +76,7 @@ class Magic public static function classExists() { \set_error_handler(['\\danog\\MadelineProto\\Exception', 'ExceptionErrorHandler']); - \set_exception_handler(['\\danog\\MadelineProto\\Exception', 'ExceptionHandler']); + \set_exceptionHandler(['\\danog\\MadelineProto\\Exception', 'ExceptionHandler']); if (!self::$inited) { if (!\defined('\\phpseclib\\Crypt\\Common\\SymmetricKey::MODE_IGE') || \phpseclib\Crypt\Common\SymmetricKey::MODE_IGE !== 7) { throw new Exception(\danog\MadelineProto\Lang::$current_lang['phpseclib_fork']); @@ -202,7 +202,7 @@ class Magic public static function isFork() { - if (self::$is_fork) { + if (self::$isFork) { return true; } if (!self::$can_getmypid) { @@ -214,7 +214,7 @@ class Magic self::$pid = \getmypid(); } - return self::$is_fork = self::$pid !== \getmypid(); + return self::$isFork = self::$pid !== \getmypid(); } catch (\danog\MadelineProto\Exception $e) { return self::$can_getmypid = false; } diff --git a/src/danog/MadelineProto/RPCErrorException.php b/src/danog/MadelineProto/RPCErrorException.php index 5806efb5..9f14930b 100644 --- a/src/danog/MadelineProto/RPCErrorException.php +++ b/src/danog/MadelineProto/RPCErrorException.php @@ -121,7 +121,7 @@ class RPCErrorException extends \Exception $additional = []; foreach ($this->getTrace() as $level) { - if (isset($level['function']) && $level['function'] === 'method_call') { + if (isset($level['function']) && $level['function'] === 'methodCall') { $this->line = $level['line']; $this->file = $level['file']; $additional = $level['args']; diff --git a/src/danog/MadelineProto/Server.php b/src/danog/MadelineProto/Server.php index 5972b8d7..04fc496f 100644 --- a/src/danog/MadelineProto/Server.php +++ b/src/danog/MadelineProto/Server.php @@ -46,9 +46,9 @@ class Server public function start() { - \pcntl_signal(SIGTERM, [$this, 'sig_handler']); - \pcntl_signal(SIGINT, [$this, 'sig_handler']); - \pcntl_signal(SIGCHLD, [$this, 'sig_handler']); + \pcntl_signal(SIGTERM, [$this, 'sigHandler']); + \pcntl_signal(SIGINT, [$this, 'sigHandler']); + \pcntl_signal(SIGCHLD, [$this, 'sigHandler']); $this->sock = new \Socket($this->settings['type'], SOCK_STREAM, $this->settings['protocol']); $this->sock->bind($this->settings['address'], $this->settings['port']); diff --git a/src/danog/MadelineProto/Server/Handler.php b/src/danog/MadelineProto/Server/Handler.php index 8aa265f8..9bcb8036 100644 --- a/src/danog/MadelineProto/Server/Handler.php +++ b/src/danog/MadelineProto/Server/Handler.php @@ -104,7 +104,7 @@ class Handler extends \danog\MadelineProto\Connection $buffer = ''; } else { $time = \time(); - $message = $this->read_message(); + $message = $this->readMessage(); } } catch (\danog\MadelineProto\NothingInTheSocketException $e) { echo $e; @@ -148,10 +148,10 @@ class Handler extends \danog\MadelineProto\Connection if ($method[0] === '__construct') { if (\count($args) === 1 && \is_array($args[0])) { $args[0]['logger'] = ['logger' => 4, 'logger_param' => [$this, 'logger']]; - $args[0]['updates']['callback'] = [$this, 'update_handler']; + $args[0]['updates']['callback'] = [$this, 'updateHandler']; } elseif (\count($args) === 2 && \is_array($args[1])) { $args[1]['logger'] = ['logger' => 4, 'logger_param' => [$this, 'logger']]; - $args[1]['updates']['callback'] = [$this, 'update_handler']; + $args[1]['updates']['callback'] = [$this, 'updateHandler']; } $this->madeline = new \danog\MadelineProto\API(...$args); @@ -227,7 +227,7 @@ class Handler extends \danog\MadelineProto\Connection $tl = false; foreach (\array_reverse($e->getTrace()) as $k => $frame) { $tl_frame = ['_' => 'socketTLFrame']; - if (isset($frame['function']) && \in_array($frame['function'], ['serialize_params', 'serialize_object'])) { + if (isset($frame['function']) && \in_array($frame['function'], ['serializeParams', 'serializeObject'])) { if ($frame['args'][2] !== '') { $tl_frame['tl_param'] = (string) $frame['args'][2]; $tl = true; @@ -290,7 +290,7 @@ class Handler extends \danog\MadelineProto\Connection } try { - $this->send_message($message); + $this->sendMessage($message); } catch (\danog\MadelineProto\Exception $e) { $this->__destruct(); die; diff --git a/src/danog/MadelineProto/Server/Proxy.php b/src/danog/MadelineProto/Server/Proxy.php index e970de1f..29fada80 100644 --- a/src/danog/MadelineProto/Server/Proxy.php +++ b/src/danog/MadelineProto/Server/Proxy.php @@ -89,11 +89,11 @@ class Proxy extends \danog\MadelineProto\Connection \Socket::select($read, $write, $except, $timeout); if (isset($read[0])) { //\danog\MadelineProto\Logger::log("Will write to DC $dc on ".\danog\MadelineProto\Magic::$pid); - $socket->send_message($this->read_message()); + $socket->sendMessage($this->readMessage()); } if (isset($read[1])) { //\danog\MadelineProto\Logger::log("Will read from DC $dc on ".\danog\MadelineProto\Magic::$pid); - $this->send_message($socket->read_message()); + $this->sendMessage($socket->readMessage()); } if (empty($read)) { throw new \danog\MadelineProto\NothingInTheSocketException('Inactivity'); diff --git a/src/danog/MadelineProto/TL/Conversion/TD.php b/src/danog/MadelineProto/TL/Conversion/TD.php index 27fc2917..fef024d0 100644 --- a/src/danog/MadelineProto/TL/Conversion/TD.php +++ b/src/danog/MadelineProto/TL/Conversion/TD.php @@ -27,7 +27,7 @@ trait TD return $params; } if (!isset($params['ID'])) { - \array_walk($params, [$this, 'tdcli_to_td']); + \array_walk($params, [$this, 'tdcliToTd']); return $params; } diff --git a/src/danog/MadelineProto/TL/PrettyException.php b/src/danog/MadelineProto/TL/PrettyException.php index a23a7f63..f305d7be 100644 --- a/src/danog/MadelineProto/TL/PrettyException.php +++ b/src/danog/MadelineProto/TL/PrettyException.php @@ -88,7 +88,7 @@ trait PrettyException } $tl = false; foreach (\array_reverse($trace ?? $this->getTrace()) as $k => $frame) { - if (isset($frame['function']) && \in_array($frame['function'], ['serialize_params', 'serialize_object'])) { + if (isset($frame['function']) && \in_array($frame['function'], ['serializeParams', 'serializeObject'])) { if ($frame['args'][2] !== '') { $this->tl_trace .= $tl ? "['".$frame['args'][2]."']" : "While serializing: \t".$frame['args'][2]; $tl = true; diff --git a/src/danog/MadelineProto/TL/Types/Button.php b/src/danog/MadelineProto/TL/Types/Button.php index 3bb3e38b..96ae2e61 100644 --- a/src/danog/MadelineProto/TL/Types/Button.php +++ b/src/danog/MadelineProto/TL/Types/Button.php @@ -46,7 +46,7 @@ class Button implements \JsonSerializable, \ArrayAccess $donotwait = false; } $async = $params['async'] ?? (isset($this->info['API']->wrapper) ? $this->info['API']->wrapper->async : true); - $method = $donotwait ? 'method_call_async_write' : 'method_call_async_read'; + $method = $donotwait ? 'methodCallAsyncWrite' : 'methodCallAsyncRead'; switch ($this->data['_']) { default: return false; diff --git a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php index 35093b04..240d6bb7 100644 --- a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php +++ b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php @@ -245,7 +245,7 @@ trait AuthKeyHandler if (isset($this->settings['pwr']['strict']) && $this->settings['pwr']['strict']) { $this->pwrUpdateHandler($update); } else { - \in_array($this->settings['updates']['callback'], [['danog\\MadelineProto\\API', 'get_updates_update_handler'], 'get_updates_update_handler']) ? $this->getUpdatesUpdateHandler($update) : $this->settings['updates']['callback']($update); + \in_array($this->settings['updates']['callback'], [['danog\\MadelineProto\\API', 'getUpdatesUpdateHandler'], 'getUpdatesUpdateHandler']) ? $this->getUpdatesUpdateHandler($update) : $this->settings['updates']['callback']($update); } unset($this->calls[$call['id']]); } diff --git a/src/danog/MadelineProto/Wrappers/ApiStart.php b/src/danog/MadelineProto/Wrappers/ApiStart.php index b295d4a6..dc0c003a 100644 --- a/src/danog/MadelineProto/Wrappers/ApiStart.php +++ b/src/danog/MadelineProto/Wrappers/ApiStart.php @@ -76,7 +76,7 @@ Note that you can also provide the API parameters directly in the code using the } else { yield $this->webAPIEcho(); } - } elseif (!$this->my_telegram_org_wrapper->logged_in()) { + } elseif (!$this->my_telegram_org_wrapper->loggedIn()) { if (isset($_POST['code'])) { yield $this->webAPICompleteLogin(); if (yield $this->my_telegram_org_wrapper->hasApp()) { diff --git a/src/danog/MadelineProto/Wrappers/ApiTemplates.php b/src/danog/MadelineProto/Wrappers/ApiTemplates.php index 2be5a6ec..2d6bf58e 100644 --- a/src/danog/MadelineProto/Wrappers/ApiTemplates.php +++ b/src/danog/MadelineProto/Wrappers/ApiTemplates.php @@ -82,7 +82,7 @@ trait ApiTemplates yield $stdout->write($this->webAPIEchoTemplate('Do you want to enter the API id and the API hash manually or automatically?
Note that you can also provide it directly in the code using the settings.'.$message.'', '')); } } else { - if (!$this->my_telegram_org_wrapper->logged_in()) { + if (!$this->my_telegram_org_wrapper->loggedIn()) { yield $stdout->write($this->webAPIEchoTemplate('Enter your code
'.$message.'', '')); } else { yield $stdout->write($this->webAPIEchoTemplate( diff --git a/src/danog/MadelineProto/Wrappers/Callback.php b/src/danog/MadelineProto/Wrappers/Callback.php index 7f5a0206..ea5a3165 100644 --- a/src/danog/MadelineProto/Wrappers/Callback.php +++ b/src/danog/MadelineProto/Wrappers/Callback.php @@ -28,7 +28,7 @@ trait Callback { $this->settings['updates']['callback'] = $callback; $this->settings['updates']['run_callback'] = true; - $this->settings['updates']['handle_updates'] = true; + $this->settings['updates']['handleUpdates'] = true; $this->startUpdateSystem(); } } diff --git a/src/danog/MadelineProto/Wrappers/Events.php b/src/danog/MadelineProto/Wrappers/Events.php index 9fd8d459..336c28f8 100644 --- a/src/danog/MadelineProto/Wrappers/Events.php +++ b/src/danog/MadelineProto/Wrappers/Events.php @@ -58,8 +58,8 @@ trait Events } } - $this->settings['updates']['callback'] = [$this, 'event_update_handler']; - $this->settings['updates']['handle_updates'] = true; + $this->settings['updates']['callback'] = [$this, 'eventUpdateHandler']; + $this->settings['updates']['handleUpdates'] = true; $this->settings['updates']['run_callback'] = true; if (!$this->asyncInitPromise) { $this->startUpdateSystem(); diff --git a/src/danog/MadelineProto/Wrappers/Login.php b/src/danog/MadelineProto/Wrappers/Login.php index cc3526ef..5de94607 100644 --- a/src/danog/MadelineProto/Wrappers/Login.php +++ b/src/danog/MadelineProto/Wrappers/Login.php @@ -40,7 +40,7 @@ trait Login public function botLogin($token) { if ($this->authorized === self::LOGGED_IN) { - $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_logged_in'], \danog\MadelineProto\Logger::NOTICE); + $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE); yield $this->logout(); } $callbacks = [$this, $this->referenceDatabase]; @@ -64,7 +64,7 @@ trait Login public function phoneLogin($number, $sms_type = 5) { if ($this->authorized === self::LOGGED_IN) { - $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_logged_in'], \danog\MadelineProto\Logger::NOTICE); + $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE); yield $this->logout(); } $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_code_sending'], \danog\MadelineProto\Logger::NOTICE); @@ -134,7 +134,7 @@ trait Login public function importAuthorization($authorization) { if ($this->authorized === self::LOGGED_IN) { - $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_logged_in'], \danog\MadelineProto\Logger::NOTICE); + $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE); yield $this->logout(); } $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_auth_key'], \danog\MadelineProto\Logger::NOTICE); @@ -169,7 +169,7 @@ trait Login public function exportAuthorization() { if ($this->authorized !== self::LOGGED_IN) { - throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['not_logged_in']); + throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['not_loggedIn']); } yield $this->getSelf(); $this->authorized_dc = $this->datacenter->curdc; diff --git a/src/danog/MadelineProto/Wrappers/Loop.php b/src/danog/MadelineProto/Wrappers/Loop.php index facbe366..581e2460 100644 --- a/src/danog/MadelineProto/Wrappers/Loop.php +++ b/src/danog/MadelineProto/Wrappers/Loop.php @@ -52,7 +52,7 @@ trait Loop return false; } - if (\in_array($this->settings['updates']['callback'], [['danog\\MadelineProto\\API', 'get_updates_update_handler'], 'get_updates_update_handler'])) { + if (\in_array($this->settings['updates']['callback'], [['danog\\MadelineProto\\API', 'getUpdatesUpdateHandler'], 'getUpdatesUpdateHandler'])) { $this->logger->logger('Getupdates event handler is enabled, exiting from loop', \danog\MadelineProto\Logger::FATAL_ERROR); return false; @@ -140,8 +140,8 @@ trait Loop $this->closeConnection('Bot was started'); } - if (!$this->settings['updates']['handle_updates']) { - $this->settings['updates']['handle_updates'] = true; + if (!$this->settings['updates']['handleUpdates']) { + $this->settings['updates']['handleUpdates'] = true; } if (!$this->settings['updates']['run_callback']) { $this->settings['updates']['run_callback'] = true; diff --git a/src/danog/MadelineProto/Wrappers/Noop.php b/src/danog/MadelineProto/Wrappers/Noop.php index be979e29..b498c2e9 100644 --- a/src/danog/MadelineProto/Wrappers/Noop.php +++ b/src/danog/MadelineProto/Wrappers/Noop.php @@ -25,7 +25,7 @@ trait Noop { $this->settings['updates']['callback'] = [$this, 'noop']; $this->settings['updates']['run_callback'] = false; - $this->settings['updates']['handle_updates'] = true; + $this->settings['updates']['handleUpdates'] = true; $this->startUpdateSystem(); } diff --git a/src/danog/MadelineProto/Wrappers/TOS.php b/src/danog/MadelineProto/Wrappers/TOS.php index 4054a653..7d0b8503 100644 --- a/src/danog/MadelineProto/Wrappers/TOS.php +++ b/src/danog/MadelineProto/Wrappers/TOS.php @@ -35,8 +35,8 @@ trait TOS if (!$this->tos['accepted']) { $this->logger->logger('Telegram has updated their Terms Of Service', \danog\MadelineProto\Logger::ERROR); - $this->logger->logger('Accept the TOS before proceeding by calling $MadelineProto->accept_tos().', \danog\MadelineProto\Logger::ERROR); - $this->logger->logger('You can also decline the TOS by calling $MadelineProto->decline_tos().', \danog\MadelineProto\Logger::ERROR); + $this->logger->logger('Accept the TOS before proceeding by calling $MadelineProto->acceptTos().', \danog\MadelineProto\Logger::ERROR); + $this->logger->logger('You can also decline the TOS by calling $MadelineProto->declineTos().', \danog\MadelineProto\Logger::ERROR); $this->logger->logger('By declining the TOS, the currently logged in account will be PERMANENTLY DELETED.', \danog\MadelineProto\Logger::FATAL_ERROR); $this->logger->logger('Read the following TOS very carefully: ', \danog\MadelineProto\Logger::ERROR); $this->logger->logger($this->tos); diff --git a/src/danog/MadelineProto/Wrappers/Webhook.php b/src/danog/MadelineProto/Wrappers/Webhook.php index e0a0fb3e..271e7d7f 100644 --- a/src/danog/MadelineProto/Wrappers/Webhook.php +++ b/src/danog/MadelineProto/Wrappers/Webhook.php @@ -28,9 +28,9 @@ trait Webhook { $this->pem_path = $pem_path; $this->hook_url = $hook_url; - $this->settings['updates']['callback'] = [$this, 'pwr_webhook']; + $this->settings['updates']['callback'] = [$this, 'pwrWebhook']; $this->settings['updates']['run_callback'] = true; - $this->settings['updates']['handle_updates'] = true; + $this->settings['updates']['handleUpdates'] = true; $this->startUpdateSystem(); } } diff --git a/tests/testing.php b/tests/testing.php index 18d9c960..8984cb1c 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -55,14 +55,14 @@ $MadelineProto->start(); $MadelineProto->async(false); try { - $MadelineProto->get_self(); + $MadelineProto->getSelf(); } catch (\danog\MadelineProto\Exception $e) { if ($e->getMessage() === 'TOS action required, check the logs') { - $MadelineProto->accept_tos(); + $MadelineProto->acceptTos(); } } -//var_dump(count($MadelineProto->get_pwr_chat('@madelineproto')['participants'])); +//var_dump(count($MadelineProto->getPwrChat('@madelineproto')['participants'])); /* * Test logging @@ -83,13 +83,13 @@ $message = (\getenv('TRAVIS_COMMIT') == '') ? 'I iz works always (io laborare se * Try making a phone call */ if (!\getenv('TRAVIS_COMMIT') && \stripos($MadelineProto->readline('Do you want to make a call? (y/n): '), 'y') !== false) { - $controller = $MadelineProto->request_call(\getenv('TEST_SECRET_CHAT'))->play('input.raw')->then('input.raw')->playOnHold(['input.raw'])->setOutputFile('output.raw'); + $controller = $MadelineProto->requestCall(\getenv('TEST_SECRET_CHAT'))->play('input.raw')->then('input.raw')->playOnHold(['input.raw'])->setOutputFile('output.raw'); while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_READY) { - $MadelineProto->get_updates(); + $MadelineProto->getUpdates(); } \danog\MadelineProto\Logger::log($controller->configuration); while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_ENDED) { - $MadelineProto->get_updates(); + $MadelineProto->getUpdates(); } } @@ -100,7 +100,7 @@ if (!\getenv('TRAVIS_COMMIT') && \stripos($MadelineProto->readline('Do you want $howmany = $MadelineProto->readline('How many calls would you like me to handle? '); $offset = 0; while ($howmany > 0) { - $updates = $MadelineProto->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout + $updates = $MadelineProto->getUpdates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout foreach ($updates as $update) { \danog\MadelineProto\Logger::log($update); $offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id @@ -122,14 +122,14 @@ if (!\getenv('TRAVIS_COMMIT') && \stripos($MadelineProto->readline('Do you want /** * Request a secret chat. */ - $secret_chat_id = $MadelineProto->request_secret_chat(\getenv('TEST_SECRET_CHAT')); + $secret_chat_id = $MadelineProto->requestSecretChat(\getenv('TEST_SECRET_CHAT')); echo 'Waiting for '.\getenv('TEST_SECRET_CHAT').' (secret chat id '.$secret_chat_id.') to accept the secret chat...'.PHP_EOL; /* * Wait until the other party accepts it */ - while ($MadelineProto->secret_chat_status($secret_chat_id) !== 2) { - $MadelineProto->get_updates(); + while ($MadelineProto->secretChatStatus($secret_chat_id) !== 2) { + $MadelineProto->getUpdates(); } /** @@ -219,7 +219,7 @@ if (!\getenv('TRAVIS_COMMIT') && \stripos($MadelineProto->readline('Do you want } } -$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 = $MadelineProto->getInfo(\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 = []; @@ -242,7 +242,7 @@ $media['voice'] = ['_' => 'inputMediaUploadedDocument', 'file' => 'tests/mosconi $media['document'] = ['_' => 'inputMediaUploadedDocument', 'file' => 'tests/60', 'mime_type' => 'magic/magic', 'attributes' => [['_' => 'documentAttributeFilename', 'file_name' => 'magic.magic']]]; $message = 'yay '.\PHP_VERSION_ID; -$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 = $MadelineProto->getInfo(\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 /* diff --git a/tools/layerdiff.php b/tools/layerdiff.php index a6feefca..3fbfbdbe 100644 --- a/tools/layerdiff.php +++ b/tools/layerdiff.php @@ -58,7 +58,7 @@ $new = getTL($argv[2]); $res = ''; foreach (['methods', 'constructors'] as $type) { - $finder = $type === 'methods' ? 'find_by_method' : 'find_by_predicate'; + $finder = $type === 'methods' ? 'findByMethod' : 'findByPredicate'; $key = $type === 'methods' ? 'method' : 'predicate'; // New constructors diff --git a/tools/std.php b/tools/std.php index da93cc39..30fa1f6b 100644 --- a/tools/std.php +++ b/tools/std.php @@ -24,11 +24,15 @@ function ssort($a, $b) $find = []; $replace = []; +$findDocs = []; +$replaceDocs = []; foreach ($methods as $methodObj) { $method = $methodObj->getName(); if (\strpos($method, '__') === 0 || $method === 'async') { continue; } + $method = Tools::fromCamelCase($method); + $new = Tools::fromSnakeCase($method); $new = \str_ireplace(['mtproto', 'api'], ['MTProto', 'API'], $new); $new = \preg_replace('/TL$/i', 'TL', $new); @@ -36,14 +40,32 @@ foreach ($methods as $methodObj) { $new = \preg_replace('/async$/i', '', $new); } + $findDocs []= Tools::fromCamelCase($new).'('; + $replaceDocs []= $new.'('; + + $findDocs []= $method.'('; + $replaceDocs []= $new.'('; + + $findDocs []= Tools::fromCamelCase($new).'.'; + $replaceDocs []= $new.'.'; + + $findDocs []= $method.'.'; + $replaceDocs []= $new.'.'; + + $findDocs []= Tools::fromCamelCase($new).']'; + $replaceDocs []= $new.']'; + + $findDocs []= $method.']'; + $replaceDocs []= $new.']'; + if (\method_exists((string) $methodObj->getDeclaringClass(), \preg_replace('/async$/i', '', $method))) { \var_dump("Skipping $method => $new"); continue; } if (!\function_exists($method)) { - $find[] = "$method("; - $replace[] = "$new("; + $find[] = "$method"; + $replace[] = "$new"; continue; } $find[] = ">$method("; @@ -68,16 +90,16 @@ exit; foreach (new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(\realpath('docs'))), '/\.md$/') as $filename) { $filename = (string) $filename; - $new = \str_replace($find, $replace, $old = \file_get_contents($filename)); + $new = \str_replace($findDocs, $replaceDocs, $old = \file_get_contents($filename)); do { \file_put_contents($filename, $new); - $new = \str_replace($find, $replace, $old = \file_get_contents($filename)); + $new = \str_replace($findDocs, $replaceDocs, $old = \file_get_contents($filename)); } while ($old !== $new); } $filename = 'README.md'; - $new = \str_replace($find, $replace, $old = \file_get_contents($filename)); + $new = \str_replace($findDocs, $replaceDocs, $old = \file_get_contents($filename)); do { \file_put_contents($filename, $new); - $new = \str_replace($find, $replace, $old = \file_get_contents($filename)); + $new = \str_replace($findDocs, $replaceDocs, $old = \file_get_contents($filename)); } while ($old !== $new); diff --git a/tools/translator.php b/tools/translator.php index 912f28ee..766710cb 100644 --- a/tools/translator.php +++ b/tools/translator.php @@ -28,7 +28,7 @@ class Lang // THIS WILL BE OVERWRITTEN BY $lang["en"] public static $current_lang = %s; }'; -function from_camel_case($input) +function fromCamelCase($input) { \preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); $ret = $matches[0]; @@ -92,7 +92,7 @@ foreach (\danog\MadelineProto\Lang::$current_lang as $key => $value) { $l = \str_replace('_', ' ', $param_name); } else { $l = \explode('.', $method_name); - $l = from_camel_case(\end($l)); + $l = fromCamelCase(\end($l)); } $l = \ucfirst(\strtolower($l)); if (\preg_match('/ empty$/', $l)) {