TOS update, update to layer 81, improve GUI/cli interface

This commit is contained in:
Daniil Gentili 2018-06-29 13:50:14 +02:00
parent 4bbd6c0b59
commit 87a989d0cf
21 changed files with 2131 additions and 87 deletions

View File

@ -77,7 +77,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* [Avoiding FLOOD_WAITs](https://docs.madelineproto.xyz/docs/FLOOD_WAIT.html)
* [Logging](https://docs.madelineproto.xyz/docs/LOGGING.html)
* [Using methods](https://docs.madelineproto.xyz/docs/USING_METHODS.html)
* [FULL API Documentation with descriptions](https://docs.madelineproto.xyz/API_docs/methods)
* [FULL API Documentation with descriptions](https://docs.madelineproto.xyz/API_docs/methods/)
* [Peers](https://docs.madelineproto.xyz/docs/USING_METHODS.html#peers)
* [Files](https://docs.madelineproto.xyz/docs/FILES.html)
* [Secret chats](https://docs.madelineproto.xyz/docs/USING_METHODS.html#secret-chats)

View File

@ -43,9 +43,9 @@ $docs = [
'readme' => false,
],
[
'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v75.tl', 'calls' => __DIR__.'/src/danog/MadelineProto/TL_calls.tl', 'secret' => __DIR__.'/src/danog/MadelineProto/TL_secret.tl', 'td' => __DIR__.'/src/danog/MadelineProto/TL_td.tl'],
'title' => 'MadelineProto API documentation (layer 75)',
'description' => 'MadelineProto API documentation (layer 75)',
'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v81.tl', 'calls' => __DIR__.'/src/danog/MadelineProto/TL_calls.tl', 'secret' => __DIR__.'/src/danog/MadelineProto/TL_secret.tl', 'td' => __DIR__.'/src/danog/MadelineProto/TL_td.tl'],
'title' => 'MadelineProto API documentation (layer 81)',
'description' => 'MadelineProto API documentation (layer 81)',
'output_dir' => __DIR__.'/docs/docs/API_docs',
'readme' => false,
],

2
docs

@ -1 +1 @@
Subproject commit 329a5e2f7bb99186c4b8f3c8693269774deed9c5
Subproject commit 9a27a19fe5b9984e9f1d637aa516502fdfd1699e

View File

@ -139,6 +139,10 @@ class APIFactory
Logger::log("Didn't serialize in a while, doing that now...");
$this->serialize($this->session);
}
if ($name !== 'accept_tos' && $name !== 'decline_tos') {
$this->API->check_tos();
}
if ($this->lua === false) {
return method_exists($this->API, $this->namespace.$name) ? $this->API->{$this->namespace.$name}(...$arguments) : $this->API->method_call($this->namespace.$name, isset($arguments[0]) && is_array($arguments[0]) ? $arguments[0] : [], $aargs);
}

View File

@ -70,7 +70,7 @@ trait Methods
$this->docs_methods[$method] = '$MadelineProto->'.$md_method.'(\\['.$params.'\\]) === [$'.str_replace('_', '\\_', $type).'](../types/'.$php_type.'.md)<a name="'.$method.'"></a>
';
if (!isset(\danog\MadelineProto\MTProto::DISALLOWED_METHODS[$data['method']])) {
if (!isset(\danog\MadelineProto\MTProto::DISALLOWED_METHODS[$data['method']]) && isset($this->td_descriptions['methods'][$data['method']])) {
$this->human_docs_methods[$this->td_descriptions['methods'][$data['method']]['description'].': '.$data['method']] = '* <a href="'.$method.'.html" name="'.$method.'">'.$this->td_descriptions['methods'][$data['method']]['description'].': '.$data['method'].'</a>
';

View File

@ -9,15 +9,6 @@ namespace danog\MadelineProto;
interface auth
{
/**
* @param array params [
* string phone_number,
* ]
*
* @return auth_CheckedPhone
*/
public function checkPhone(array $params);
/**
* @param array params [
* boolean allow_flashcall,
@ -65,16 +56,6 @@ interface auth
*/
public function resetAuthorizations();
/**
* @param array params [
* string phone_numbers,
* string message,
* ]
*
* @return bool
*/
public function sendInvites(array $params);
/**
* @param array params [
* int dc_id,
@ -177,6 +158,7 @@ interface account
* int token_type,
* string token,
* Bool app_sandbox,
* bytes secret,
* int other_uids,
* ]
*
@ -432,6 +414,128 @@ interface account
* @return bool
*/
public function resetWebAuthorizations();
/**
* @return Vector_of_SecureValue
*/
public function getAllSecureValues();
/**
* @param array params [
* SecureValueType types,
* ]
*
* @return Vector_of_SecureValue
*/
public function getSecureValue(array $params);
/**
* @param array params [
* InputSecureValue value,
* long secure_secret_id,
* ]
*
* @return SecureValue
*/
public function saveSecureValue(array $params);
/**
* @param array params [
* SecureValueType types,
* ]
*
* @return bool
*/
public function deleteSecureValue(array $params);
/**
* @param array params [
* int bot_id,
* string scope,
* string public_key,
* ]
*
* @return account_AuthorizationForm
*/
public function getAuthorizationForm(array $params);
/**
* @param array params [
* int bot_id,
* string scope,
* string public_key,
* SecureValueHash value_hashes,
* SecureCredentialsEncrypted credentials,
* ]
*
* @return bool
*/
public function acceptAuthorization(array $params);
/**
* @param array params [
* boolean allow_flashcall,
* string phone_number,
* Bool current_number,
* ]
*
* @return auth_SentCode
*/
public function sendVerifyPhoneCode(array $params);
/**
* @param array params [
* string phone_number,
* string phone_code_hash,
* string phone_code,
* ]
*
* @return bool
*/
public function verifyPhone(array $params);
/**
* @param array params [
* string email,
* ]
*
* @return account_SentEmailCode
*/
public function sendVerifyEmailCode(array $params);
/**
* @param array params [
* string email,
* string code,
* ]
*
* @return bool
*/
public function verifyEmail(array $params);
/**
* @param array params [
* boolean contacts,
* boolean message_users,
* boolean message_chats,
* boolean message_megagroups,
* boolean message_channels,
* boolean files,
* int file_max_size,
* ]
*
* @return account_Takeout
*/
public function initTakeoutSession(array $params);
/**
* @param array params [
* boolean success,
* ]
*
* @return bool
*/
public function finishTakeoutSession(array $params);
}
interface users
@ -453,6 +557,16 @@ interface users
* @return UserFull
*/
public function getFullUser(array $params);
/**
* @param array params [
* InputUser id,
* SecureValueError errors,
* ]
*
* @return bool
*/
public function setSecureValueErrors(array $params);
}
interface contacts
@ -590,6 +704,11 @@ interface contacts
* @return bool
*/
public function resetSaved();
/**
* @return Vector_of_SavedContact
*/
public function getSaved();
}
interface messages
@ -645,6 +764,7 @@ interface messages
* int limit,
* int max_id,
* int min_id,
* int hash,
* ]
*
* @return messages_Messages
@ -777,6 +897,17 @@ interface messages
*/
public function getPeerSettings(array $params);
/**
* @param array params [
* InputPeer peer,
* int id,
* ReportReason reason,
* ]
*
* @return bool
*/
public function report(array $params);
/**
* @param array params [
* int id,
@ -967,7 +1098,7 @@ interface messages
/**
* @param array params [
* string emoticon,
* string hash,
* int hash,
* ]
*
* @return messages_Stickers
@ -1223,6 +1354,7 @@ interface messages
* InputPeer peer,
* int id,
* string message,
* InputMedia media,
* ReplyMarkup reply_markup,
* MessageEntity entities,
* InputGeoPoint geo_point,
@ -1238,6 +1370,7 @@ interface messages
* boolean stop_geo_live,
* InputBotInlineMessageID id,
* string message,
* InputMedia media,
* ReplyMarkup reply_markup,
* MessageEntity entities,
* InputGeoPoint geo_point,
@ -1274,7 +1407,7 @@ interface messages
/**
* @param array params [
* InputPeer peers,
* InputDialogPeer peers,
* ]
*
* @return messages_PeerDialogs
@ -1457,7 +1590,7 @@ interface messages
/**
* @param array params [
* boolean pinned,
* InputPeer peer,
* InputDialogPeer peer,
* ]
*
* @return bool
@ -1467,7 +1600,7 @@ interface messages
/**
* @param array params [
* boolean force,
* InputPeer order,
* InputDialogPeer order,
* ]
*
* @return bool
@ -1567,6 +1700,7 @@ interface messages
* @param array params [
* InputPeer peer,
* int limit,
* int hash,
* ]
*
* @return messages_Messages
@ -1596,6 +1730,22 @@ interface messages
* @return EncryptedFile
*/
public function uploadEncryptedFile(array $params);
/**
* @param array params [
* boolean exclude_featured,
* string q,
* int hash,
* ]
*
* @return messages_FoundStickerSets
*/
public function searchStickerSets(array $params);
/**
* @return Vector_of_MessageRange
*/
public function getSplitRanges();
}
interface updates
@ -1737,7 +1887,7 @@ interface upload
* bytes request_token,
* ]
*
* @return Vector_of_CdnFileHash
* @return Vector_of_FileHash
*/
public function reuploadCdnFile(array $params);
@ -1747,9 +1897,19 @@ interface upload
* int offset,
* ]
*
* @return Vector_of_CdnFileHash
* @return Vector_of_FileHash
*/
public function getCdnFileHashes(array $params);
/**
* @param array params [
* InputFileLocation location,
* int offset,
* ]
*
* @return Vector_of_FileHash
*/
public function getFileHashes(array $params);
}
interface help
@ -1797,11 +1957,6 @@ interface help
*/
public function getAppChangelog(array $params);
/**
* @return help_TermsOfService
*/
public function getTermsOfService();
/**
* @param array params [
* int pending_updates_count,
@ -1825,6 +1980,34 @@ interface help
* @return help_RecentMeUrls
*/
public function getRecentMeUrls(array $params);
/**
* @return help_ProxyData
*/
public function getProxyData();
/**
* @return help_TermsOfServiceUpdate
*/
public function getTermsOfServiceUpdate();
/**
* @param array params [
* DataJSON id,
* ]
*
* @return bool
*/
public function acceptTermsOfService(array $params);
/**
* @param array params [
* string path,
* ]
*
* @return help_DeepLinkInfo
*/
public function getDeepLinkInfo(array $params);
}
interface channels
@ -2152,6 +2335,15 @@ interface channels
* @return Updates
*/
public function togglePreHistoryHidden(array $params);
/**
* @param array params [
* int offset,
* ]
*
* @return messages_Chats
*/
public function getLeftChannels(array $params);
}
interface bots

View File

@ -1275,15 +1275,15 @@ class Lang
'object_resPQ' => 'Contains pq to factorize',
'object_resPQ_param_nonce_type_int128' => 'Nonce',
'object_resPQ_param_server_nonce_type_int128' => 'Server nonce',
'object_resPQ_param_pq_type_bytes' => '',
'object_resPQ_param_server_public_key_fingerprints_type_Vector t' => '',
'object_p_q_inner_data' => '',
'object_p_q_inner_data_param_pq_type_bytes' => '',
'object_p_q_inner_data_param_p_type_bytes' => '',
'object_p_q_inner_data_param_q_type_bytes' => '',
'object_p_q_inner_data_param_nonce_type_int128' => '',
'object_p_q_inner_data_param_server_nonce_type_int128' => '',
'object_p_q_inner_data_param_new_nonce_type_int256' => '',
'object_resPQ_param_pq_type_bytes' => 'PQ ',
'object_resPQ_param_server_public_key_fingerprints_type_Vector t' => 'RSA key fingerprints',
'object_p_q_inner_data' => 'PQ inner data',
'object_p_q_inner_data_param_pq_type_bytes' => 'PQ',
'object_p_q_inner_data_param_p_type_bytes' => 'P',
'object_p_q_inner_data_param_q_type_bytes' => 'Q',
'object_p_q_inner_data_param_nonce_type_int128' => 'Nonce',
'object_p_q_inner_data_param_server_nonce_type_int128' => 'Nonce',
'object_p_q_inner_data_param_new_nonce_type_int256' => 'Nonce',
'object_p_q_inner_data_temp' => '',
'object_p_q_inner_data_temp_param_pq_type_bytes' => '',
'object_p_q_inner_data_temp_param_p_type_bytes' => '',
@ -4108,6 +4108,306 @@ class Lang
'object_help.configSimple_param_dc_id_type_int' => '',
'object_help.configSimple_param_ip_port_list_type_Vector t' => '',
'object_inputMessagesFilterMyMentionsUnread' => '',
'method_initConnection_param_proxy_type_InputClientProxy' => 'The current proxy',
'method_account.registerDevice_param_secret_type_bytes' => 'Secret',
'method_account.getAllSecureValues' => 'Get all secure telegram passport values',
'method_account.getSecureValue' => 'Get secure value for telegram passport',
'method_account.getSecureValue_param_types_type_Vector t' => 'Get telegram passport secure parameters',
'method_account.saveSecureValue' => 'Save telegram passport secure value',
'method_account.saveSecureValue_param_value_type_InputSecureValue' => 'Encrypted value',
'method_account.saveSecureValue_param_secure_secret_id_type_long' => 'Secret',
'method_account.deleteSecureValue' => 'Delete secure telegram passport value',
'method_account.deleteSecureValue_param_types_type_Vector t' => 'The values to delete',
'method_account.getAuthorizationForm' => 'Bots only: get telegram passport authorization form',
'method_account.getAuthorizationForm_param_bot_id_type_int' => 'Bot ID',
'method_account.getAuthorizationForm_param_scope_type_string' => 'Scope',
'method_account.getAuthorizationForm_param_public_key_type_string' => 'Bot\'s public key',
'method_account.acceptAuthorization' => 'Accept telegram password authorization',
'method_account.acceptAuthorization_param_bot_id_type_int' => 'Bot ID',
'method_account.acceptAuthorization_param_scope_type_string' => 'Scope',
'method_account.acceptAuthorization_param_public_key_type_string' => 'The bot\'s RSA public key',
'method_account.acceptAuthorization_param_value_hashes_type_Vector t' => 'Hashes of the encrypted credentials',
'method_account.acceptAuthorization_param_credentials_type_SecureCredentialsEncrypted' => 'Encrypted secure credentials',
'method_account.sendVerifyPhoneCode' => 'Send phone verification code',
'method_account.sendVerifyPhoneCode_param_allow_flashcall_type_true' => 'Allow phone calls?',
'method_account.sendVerifyPhoneCode_param_phone_number_type_string' => 'The phone number',
'method_account.sendVerifyPhoneCode_param_current_number_type_Bool' => 'Is this the current number?',
'method_account.verifyPhone' => 'Verify phone number',
'method_account.verifyPhone_param_phone_number_type_string' => 'The phone number',
'method_account.verifyPhone_param_phone_code_hash_type_string' => 'The phone code hash returned by account.sendVerifyPhoneCode',
'method_account.verifyPhone_param_phone_code_type_string' => 'The phone code type returned by account.sendVerifyPhoneCode',
'method_account.sendVerifyEmailCode' => 'Send email verification code',
'method_account.sendVerifyEmailCode_param_email_type_string' => 'Email',
'method_account.verifyEmail' => 'Verify email address',
'method_account.verifyEmail_param_email_type_string' => 'The email address',
'method_account.verifyEmail_param_code_type_string' => 'The received code',
'method_users.setSecureValueErrors' => 'Set secure value error for telegram passport',
'method_users.setSecureValueErrors_param_id_type_InputUser' => 'The user ID',
'method_users.setSecureValueErrors_param_errors_type_Vector t' => 'The errors',
'method_messages.search_param_hash_type_int' => '$MadelineProto->gen_vector_hash(ids of previously fetched messages);',
'method_messages.report' => 'Report a message',
'method_messages.report_param_peer_type_InputPeer' => 'The user that sent the messages',
'method_messages.report_param_id_type_Vector t' => 'The messages to report',
'method_messages.report_param_reason_type_ReportReason' => 'The reason why you\'re sending this report',
'method_messages.getStickers_param_hash_type_int' => '$MadelineProto->gen_vector_hash(ids of previously fetched stickers, or []);',
'method_messages.editMessage_param_media_type_InputMedia' => 'The media to substitute',
'method_messages.editInlineBotMessage_param_media_type_InputMedia' => 'The media to substitute',
'method_messages.toggleDialogPin_param_peer_type_InputDialogPeer' => 'The dialog to pin',
'method_messages.getRecentLocations_param_hash_type_int' => '$MadelineProto->gen_vector_hash(ids of previously fetched locations, or []);',
'method_messages.searchStickerSets' => 'Find a sticker set',
'method_messages.searchStickerSets_param_exclude_featured_type_true' => 'Exclude featured sticker sets from the search?',
'method_messages.searchStickerSets_param_q_type_string' => 'The search query',
'method_messages.searchStickerSets_param_hash_type_int' => '$MadelineProto->gen_vector_hash(ids of previously searched stickers, or []);',
'method_upload.getFileHashes' => 'Get file hashes',
'method_upload.getFileHashes_param_location_type_InputFileLocation' => 'The file',
'method_upload.getFileHashes_param_offset_type_int' => 'Offset',
'method_help.getProxyData' => 'Get information about the current proxy',
'method_help.getTermsOfServiceUpdate' => 'Get updated TOS',
'method_help.acceptTermsOfService' => 'Accept telegram\'s TOS',
'method_help.acceptTermsOfService_param_id_type_DataJSON' => 'TOS',
'method_help.getDeepLinkInfo' => 'Get deep link info',
'method_help.getDeepLinkInfo_param_path_type_string' => 'Deep link',
'object_inputSecureFileLocation' => '',
'object_inputSecureFileLocation_param_id_type_long' => '',
'object_inputSecureFileLocation_param_access_hash_type_long' => '',
'object_messageActionBotAllowed' => '',
'object_messageActionBotAllowed_param_domain_type_string' => '',
'object_messageActionSecureValuesSentMe' => '',
'object_messageActionSecureValuesSentMe_param_values_type_Vector t' => '',
'object_messageActionSecureValuesSentMe_param_credentials_type_SecureCredentialsEncrypted' => '',
'object_messageActionSecureValuesSent' => '',
'object_messageActionSecureValuesSent_param_types_type_Vector t' => '',
'object_auth.sentCode_param_terms_of_service_type_help.TermsOfService' => '',
'object_inputPeerNotifySettings_param_silent_type_Bool' => '',
'object_peerNotifySettings_param_silent_type_Bool' => '',
'object_updateDialogPinned_param_peer_type_DialogPeer' => '',
'object_upload.fileCdnRedirect_param_file_hashes_type_Vector t' => '',
'object_dcOption_param_secret_type_bytes' => '',
'object_config_param_preload_featured_stickers_type_true' => '',
'object_config_param_ignore_phone_entities_type_true' => '',
'object_config_param_revoke_pm_inbox_type_true' => '',
'object_config_param_blocked_mode_type_true' => '',
'object_config_param_revoke_time_limit_type_int' => '',
'object_config_param_revoke_pm_time_limit_type_int' => '',
'object_config_param_autoupdate_url_prefix_type_string' => '',
'object_messages.stickers_param_hash_type_int' => '',
'object_account.noPassword_param_new_secure_salt_type_bytes' => '',
'object_account.noPassword_param_secure_random_type_bytes' => '',
'object_account.password_param_has_recovery_type_true' => '',
'object_account.password_param_has_secure_values_type_true' => '',
'object_account.password_param_new_secure_salt_type_bytes' => '',
'object_account.password_param_secure_random_type_bytes' => '',
'object_account.passwordSettings_param_secure_salt_type_bytes' => '',
'object_account.passwordSettings_param_secure_secret_type_bytes' => '',
'object_account.passwordSettings_param_secure_secret_id_type_long' => '',
'object_account.passwordInputSettings_param_new_secure_salt_type_bytes' => '',
'object_account.passwordInputSettings_param_new_secure_secret_type_bytes' => '',
'object_account.passwordInputSettings_param_new_secure_secret_id_type_long' => '',
'object_stickerSet_param_installed_date_type_int' => '',
'object_messageEntityPhone' => '',
'object_messageEntityPhone_param_offset_type_int' => '',
'object_messageEntityPhone_param_length_type_int' => '',
'object_messageEntityCashtag' => '',
'object_messageEntityCashtag_param_offset_type_int' => '',
'object_messageEntityCashtag_param_length_type_int' => '',
'object_help.termsOfService_param_popup_type_true' => '',
'object_help.termsOfService_param_id_type_DataJSON' => '',
'object_help.termsOfService_param_entities_type_Vector t' => '',
'object_help.termsOfService_param_min_age_confirm_type_int' => '',
'object_inputBotInlineMessageMediaVenue_param_venue_type_type_string' => '',
'object_inputBotInlineResult_param_thumb_type_InputWebDocument' => '',
'object_inputBotInlineResult_param_content_type_InputWebDocument' => '',
'object_botInlineMessageMediaVenue_param_venue_type_type_string' => '',
'object_botInlineResult_param_thumb_type_WebDocument' => '',
'object_botInlineResult_param_content_type_WebDocument' => '',
'object_messages.recentStickers_param_packs_type_Vector t' => '',
'object_messages.recentStickers_param_dates_type_Vector t' => '',
'object_webDocumentNoProxy' => '',
'object_webDocumentNoProxy_param_url_type_string' => '',
'object_webDocumentNoProxy_param_size_type_int' => '',
'object_webDocumentNoProxy_param_mime_type_type_string' => '',
'object_webDocumentNoProxy_param_attributes_type_Vector t' => '',
'object_inputWebFileGeoPointLocation' => '',
'object_inputWebFileGeoPointLocation_param_geo_point_type_InputGeoPoint' => '',
'object_inputWebFileGeoPointLocation_param_w_type_int' => '',
'object_inputWebFileGeoPointLocation_param_h_type_int' => '',
'object_inputWebFileGeoPointLocation_param_zoom_type_int' => '',
'object_inputWebFileGeoPointLocation_param_scale_type_int' => '',
'object_inputWebFileGeoMessageLocation' => '',
'object_inputWebFileGeoMessageLocation_param_peer_type_InputPeer' => '',
'object_inputWebFileGeoMessageLocation_param_msg_id_type_int' => '',
'object_inputWebFileGeoMessageLocation_param_w_type_int' => '',
'object_inputWebFileGeoMessageLocation_param_h_type_int' => '',
'object_inputWebFileGeoMessageLocation_param_zoom_type_int' => '',
'object_inputWebFileGeoMessageLocation_param_scale_type_int' => '',
'object_channelAdminRights_param_manage_call_type_true' => '',
'object_inputDialogPeer' => '',
'object_inputDialogPeer_param_peer_type_InputPeer' => '',
'object_dialogPeer' => '',
'object_dialogPeer_param_peer_type_Peer' => '',
'object_messages.foundStickerSetsNotModified' => '',
'object_messages.foundStickerSets' => '',
'object_messages.foundStickerSets_param_hash_type_int' => '',
'object_messages.foundStickerSets_param_sets_type_Vector t' => '',
'object_fileHash' => '',
'object_fileHash_param_offset_type_int' => '',
'object_fileHash_param_limit_type_int' => '',
'object_fileHash_param_hash_type_bytes' => '',
'object_inputClientProxy' => '',
'object_inputClientProxy_param_address_type_string' => '',
'object_inputClientProxy_param_port_type_int' => '',
'object_help.proxyDataEmpty' => '',
'object_help.proxyDataEmpty_param_expires_type_int' => '',
'object_help.proxyDataPromo' => '',
'object_help.proxyDataPromo_param_expires_type_int' => '',
'object_help.proxyDataPromo_param_peer_type_Peer' => '',
'object_help.proxyDataPromo_param_chats_type_Vector t' => '',
'object_help.proxyDataPromo_param_users_type_Vector t' => '',
'object_help.termsOfServiceUpdateEmpty' => '',
'object_help.termsOfServiceUpdateEmpty_param_expires_type_int' => '',
'object_help.termsOfServiceUpdate' => '',
'object_help.termsOfServiceUpdate_param_expires_type_int' => '',
'object_help.termsOfServiceUpdate_param_terms_of_service_type_help.TermsOfService' => '',
'object_inputSecureFileUploaded' => '',
'object_inputSecureFileUploaded_param_id_type_long' => '',
'object_inputSecureFileUploaded_param_parts_type_int' => '',
'object_inputSecureFileUploaded_param_md5_checksum_type_string' => '',
'object_inputSecureFileUploaded_param_file_hash_type_bytes' => '',
'object_inputSecureFileUploaded_param_secret_type_bytes' => '',
'object_inputSecureFile' => '',
'object_inputSecureFile_param_id_type_long' => '',
'object_inputSecureFile_param_access_hash_type_long' => '',
'object_secureFileEmpty' => '',
'object_secureFile' => '',
'object_secureFile_param_id_type_long' => '',
'object_secureFile_param_access_hash_type_long' => '',
'object_secureFile_param_size_type_int' => '',
'object_secureFile_param_dc_id_type_int' => '',
'object_secureFile_param_date_type_int' => '',
'object_secureFile_param_file_hash_type_bytes' => '',
'object_secureFile_param_secret_type_bytes' => '',
'object_secureData' => '',
'object_secureData_param_data_type_bytes' => '',
'object_secureData_param_data_hash_type_bytes' => '',
'object_secureData_param_secret_type_bytes' => '',
'object_securePlainPhone' => '',
'object_securePlainPhone_param_phone_type_string' => '',
'object_securePlainEmail' => '',
'object_securePlainEmail_param_email_type_string' => '',
'object_secureValueTypePersonalDetails' => '',
'object_secureValueTypePassport' => '',
'object_secureValueTypeDriverLicense' => '',
'object_secureValueTypeIdentityCard' => '',
'object_secureValueTypeInternalPassport' => '',
'object_secureValueTypeAddress' => '',
'object_secureValueTypeUtilityBill' => '',
'object_secureValueTypeBankStatement' => '',
'object_secureValueTypeRentalAgreement' => '',
'object_secureValueTypePassportRegistration' => '',
'object_secureValueTypeTemporaryRegistration' => '',
'object_secureValueTypePhone' => '',
'object_secureValueTypeEmail' => '',
'object_secureValue' => '',
'object_secureValue_param_type_type_SecureValueType' => '',
'object_secureValue_param_data_type_SecureData' => '',
'object_secureValue_param_front_side_type_SecureFile' => '',
'object_secureValue_param_reverse_side_type_SecureFile' => '',
'object_secureValue_param_selfie_type_SecureFile' => '',
'object_secureValue_param_files_type_Vector t' => '',
'object_secureValue_param_plain_data_type_SecurePlainData' => '',
'object_secureValue_param_hash_type_bytes' => '',
'object_inputSecureValue' => '',
'object_inputSecureValue_param_type_type_SecureValueType' => '',
'object_inputSecureValue_param_data_type_SecureData' => '',
'object_inputSecureValue_param_front_side_type_InputSecureFile' => '',
'object_inputSecureValue_param_reverse_side_type_InputSecureFile' => '',
'object_inputSecureValue_param_selfie_type_InputSecureFile' => '',
'object_inputSecureValue_param_files_type_Vector t' => '',
'object_inputSecureValue_param_plain_data_type_SecurePlainData' => '',
'object_secureValueHash' => '',
'object_secureValueHash_param_type_type_SecureValueType' => '',
'object_secureValueHash_param_hash_type_bytes' => '',
'object_secureValueErrorData' => '',
'object_secureValueErrorData_param_type_type_SecureValueType' => '',
'object_secureValueErrorData_param_data_hash_type_bytes' => '',
'object_secureValueErrorData_param_field_type_string' => '',
'object_secureValueErrorData_param_text_type_string' => '',
'object_secureValueErrorFrontSide' => '',
'object_secureValueErrorFrontSide_param_type_type_SecureValueType' => '',
'object_secureValueErrorFrontSide_param_file_hash_type_bytes' => '',
'object_secureValueErrorFrontSide_param_text_type_string' => '',
'object_secureValueErrorReverseSide' => '',
'object_secureValueErrorReverseSide_param_type_type_SecureValueType' => '',
'object_secureValueErrorReverseSide_param_file_hash_type_bytes' => '',
'object_secureValueErrorReverseSide_param_text_type_string' => '',
'object_secureValueErrorSelfie' => '',
'object_secureValueErrorSelfie_param_type_type_SecureValueType' => '',
'object_secureValueErrorSelfie_param_file_hash_type_bytes' => '',
'object_secureValueErrorSelfie_param_text_type_string' => '',
'object_secureValueErrorFile' => '',
'object_secureValueErrorFile_param_type_type_SecureValueType' => '',
'object_secureValueErrorFile_param_file_hash_type_bytes' => '',
'object_secureValueErrorFile_param_text_type_string' => '',
'object_secureValueErrorFiles' => '',
'object_secureValueErrorFiles_param_type_type_SecureValueType' => '',
'object_secureValueErrorFiles_param_file_hash_type_Vector t' => '',
'object_secureValueErrorFiles_param_text_type_string' => '',
'object_secureCredentialsEncrypted' => '',
'object_secureCredentialsEncrypted_param_data_type_bytes' => '',
'object_secureCredentialsEncrypted_param_hash_type_bytes' => '',
'object_secureCredentialsEncrypted_param_secret_type_bytes' => '',
'object_account.authorizationForm' => '',
'object_account.authorizationForm_param_selfie_required_type_true' => '',
'object_account.authorizationForm_param_required_types_type_Vector t' => '',
'object_account.authorizationForm_param_values_type_Vector t' => '',
'object_account.authorizationForm_param_errors_type_Vector t' => '',
'object_account.authorizationForm_param_users_type_Vector t' => '',
'object_account.authorizationForm_param_privacy_policy_url_type_string' => '',
'object_account.sentEmailCode' => '',
'object_account.sentEmailCode_param_email_pattern_type_string' => '',
'object_account.sentEmailCode_param_length_type_int' => '',
'object_help.deepLinkInfoEmpty' => '',
'object_help.deepLinkInfo' => '',
'object_help.deepLinkInfo_param_update_app_type_true' => '',
'object_help.deepLinkInfo_param_message_type_string' => '',
'object_help.deepLinkInfo_param_entities_type_Vector t' => '',
'method_invokeWithMessagesRange' => 'Invoke with messages range',
'method_invokeWithMessagesRange_param_range_type_MessageRange' => 'The range',
'method_invokeWithMessagesRange_param_query_type_!X' => 'The query',
'method_invokeWithTakeout' => 'Invoke method from takeout session',
'method_invokeWithTakeout_param_takeout_id_type_long' => 'The takeout session ID',
'method_invokeWithTakeout_param_query_type_!X' => 'The query',
'method_account.initTakeoutSession' => 'Start account exporting session',
'method_account.initTakeoutSession_param_contacts_type_true' => 'Export contacts?',
'method_account.initTakeoutSession_param_message_users_type_true' => 'Export users?',
'method_account.initTakeoutSession_param_message_chats_type_true' => 'Export chats?',
'method_account.initTakeoutSession_param_message_megagroups_type_true' => 'Export supergroups?',
'method_account.initTakeoutSession_param_message_channels_type_true' => 'Export channel messages?',
'method_account.initTakeoutSession_param_files_type_true' => 'Export files?',
'method_account.initTakeoutSession_param_file_max_size_type_int' => 'Export only files smaller than this size',
'method_account.finishTakeoutSession' => 'Finish account exporting session',
'method_account.finishTakeoutSession_param_success_type_true' => 'Did the data export succeed?',
'method_contacts.getSaved' => 'Get saved contacts',
'method_messages.getSplitRanges' => 'Get message ranges to fetch',
'method_channels.getLeftChannels' => 'Get all channels you left',
'method_channels.getLeftChannels_param_offset_type_int' => 'Offset',
'object_ipPortSecret' => '',
'object_ipPortSecret_param_ipv4_type_int' => '',
'object_ipPortSecret_param_port_type_int' => '',
'object_ipPortSecret_param_secret_type_bytes' => '',
'object_accessPointRule' => '',
'object_accessPointRule_param_phone_prefix_rules_type_string' => '',
'object_accessPointRule_param_dc_id_type_int' => '',
'object_accessPointRule_param_ips_type_vector' => '',
'object_help.configSimple_param_rules_type_vector' => '',
'object_inputTakeoutFileLocation' => '',
'object_savedPhoneContact' => '',
'object_savedPhoneContact_param_phone_type_string' => '',
'object_savedPhoneContact_param_first_name_type_string' => '',
'object_savedPhoneContact_param_last_name_type_string' => '',
'object_savedPhoneContact_param_date_type_int' => '',
'object_account.takeout' => '',
'object_account.takeout_param_id_type_long' => '',
),
);
@ -4490,7 +4790,7 @@ class Lang
'method_messages.search_param_filter_type_MessagesFilter' => 'Message filter',
'method_messages.search_param_min_date_type_int' => 'Minumum date of results to fetch',
'method_messages.search_param_max_date_type_int' => 'Maximum date of results to fetch',
'method_messages.search_param_offset_id_type_int' => 'Offset ',
'method_messages.search_param_offset_id_type_int' => 'Message ID offset',
'method_messages.search_param_add_offset_type_int' => 'Additional offset, can be 0',
'method_messages.search_param_limit_type_int' => 'Number of results to return',
'method_messages.search_param_max_id_type_int' => 'Maximum message id to return',
@ -4671,14 +4971,14 @@ class Lang
'method_messages.setInlineBotResults_param_cache_time_type_int' => 'Cache time',
'method_messages.setInlineBotResults_param_next_offset_type_string' => 'The next offset',
'method_messages.setInlineBotResults_param_switch_pm_type_InlineBotSwitchPM' => 'Switch to PM?',
'method_messages.sendInlineBotResult' => 'Send a received bot result to the chat',
'method_messages.sendInlineBotResult' => 'Send inline bot result obtained with messages.getInlineBotResults to the chat',
'method_messages.sendInlineBotResult_param_silent_type_true' => 'Disable notifications?',
'method_messages.sendInlineBotResult_param_background_type_true' => 'Disable background notifications?',
'method_messages.sendInlineBotResult_param_clear_draft_type_true' => 'Clear the message draft?',
'method_messages.sendInlineBotResult_param_peer_type_InputPeer' => 'Where to send the message',
'method_messages.sendInlineBotResult_param_reply_to_msg_id_type_int' => 'Reply to message by ID',
'method_messages.sendInlineBotResult_param_query_id_type_long' => 'The inline query ID',
'method_messages.sendInlineBotResult_param_id_type_string' => 'The result ID',
'method_messages.sendInlineBotResult_param_id_type_string' => 'The ID of one of the inline results',
'method_messages.getMessageEditData' => 'Check if about to edit a message or a media caption',
'method_messages.getMessageEditData_param_peer_type_InputPeer' => 'The chat',
'method_messages.getMessageEditData_param_id_type_int' => 'The message ID',
@ -4815,7 +5115,7 @@ class Lang
'method_messages.sendMultiMedia_param_reply_to_msg_id_type_int' => 'Reply to message by ID',
'method_messages.sendMultiMedia_param_multi_media_type_Vector t' => 'The album',
'method_messages.uploadEncryptedFile' => 'Upload a secret chat file without sending it to anyone',
'method_messages.uploadEncryptedFile_param_peer_type_InputEncryptedChat' => 'Ignore this',
'method_messages.uploadEncryptedFile_param_peer_type_InputEncryptedChat' => 'The chat where to upload the media',
'method_messages.uploadEncryptedFile_param_file_type_InputEncryptedFile' => 'The file',
'method_updates.getState' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates',
'method_updates.getDifference' => 'You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates',
@ -4892,9 +5192,9 @@ class Lang
'method_channels.deleteUserHistory' => 'Delete all messages of a user in a channel/supergroup',
'method_channels.deleteUserHistory_param_channel_type_InputChannel' => 'The channel/supergroup',
'method_channels.deleteUserHistory_param_user_id_type_InputUser' => 'The user',
'method_channels.reportSpam' => 'Report a supergroup/channel for spam',
'method_channels.reportSpam' => 'Report a message in a supergroup/channel for spam',
'method_channels.reportSpam_param_channel_type_InputChannel' => 'The channel',
'method_channels.reportSpam_param_user_id_type_InputUser' => 'The user that added you to this channel',
'method_channels.reportSpam_param_user_id_type_InputUser' => 'The user that sent the messages',
'method_channels.reportSpam_param_id_type_Vector t' => 'The IDs of messages to report',
'method_channels.getMessages' => 'Get channel/supergroup messages',
'method_channels.getMessages_param_channel_type_InputChannel' => 'The channel/supergroup',
@ -5229,15 +5529,15 @@ class Lang
'object_resPQ' => 'Contains pq to factorize',
'object_resPQ_param_nonce_type_int128' => 'Nonce',
'object_resPQ_param_server_nonce_type_int128' => 'Server nonce',
'object_resPQ_param_pq_type_bytes' => '',
'object_resPQ_param_server_public_key_fingerprints_type_Vector t' => '',
'object_p_q_inner_data' => '',
'object_p_q_inner_data_param_pq_type_bytes' => '',
'object_p_q_inner_data_param_p_type_bytes' => '',
'object_p_q_inner_data_param_q_type_bytes' => '',
'object_p_q_inner_data_param_nonce_type_int128' => '',
'object_p_q_inner_data_param_server_nonce_type_int128' => '',
'object_p_q_inner_data_param_new_nonce_type_int256' => '',
'object_resPQ_param_pq_type_bytes' => 'PQ ',
'object_resPQ_param_server_public_key_fingerprints_type_Vector t' => 'RSA key fingerprints',
'object_p_q_inner_data' => 'PQ inner data',
'object_p_q_inner_data_param_pq_type_bytes' => 'PQ',
'object_p_q_inner_data_param_p_type_bytes' => 'P',
'object_p_q_inner_data_param_q_type_bytes' => 'Q',
'object_p_q_inner_data_param_nonce_type_int128' => 'Nonce',
'object_p_q_inner_data_param_server_nonce_type_int128' => 'Nonce',
'object_p_q_inner_data_param_new_nonce_type_int256' => 'Nonce',
'object_p_q_inner_data_temp' => '',
'object_p_q_inner_data_temp_param_pq_type_bytes' => '',
'object_p_q_inner_data_temp_param_p_type_bytes' => '',
@ -8062,5 +8362,305 @@ class Lang
'object_help.configSimple_param_dc_id_type_int' => '',
'object_help.configSimple_param_ip_port_list_type_Vector t' => '',
'object_inputMessagesFilterMyMentionsUnread' => '',
'method_initConnection_param_proxy_type_InputClientProxy' => 'The current proxy',
'method_account.registerDevice_param_secret_type_bytes' => 'Secret',
'method_account.getAllSecureValues' => 'Get all secure telegram passport values',
'method_account.getSecureValue' => 'Get secure value for telegram passport',
'method_account.getSecureValue_param_types_type_Vector t' => 'Get telegram passport secure parameters',
'method_account.saveSecureValue' => 'Save telegram passport secure value',
'method_account.saveSecureValue_param_value_type_InputSecureValue' => 'Encrypted value',
'method_account.saveSecureValue_param_secure_secret_id_type_long' => 'Secret',
'method_account.deleteSecureValue' => 'Delete secure telegram passport value',
'method_account.deleteSecureValue_param_types_type_Vector t' => 'The values to delete',
'method_account.getAuthorizationForm' => 'Bots only: get telegram passport authorization form',
'method_account.getAuthorizationForm_param_bot_id_type_int' => 'Bot ID',
'method_account.getAuthorizationForm_param_scope_type_string' => 'Scope',
'method_account.getAuthorizationForm_param_public_key_type_string' => 'Bot\'s public key',
'method_account.acceptAuthorization' => 'Accept telegram password authorization',
'method_account.acceptAuthorization_param_bot_id_type_int' => 'Bot ID',
'method_account.acceptAuthorization_param_scope_type_string' => 'Scope',
'method_account.acceptAuthorization_param_public_key_type_string' => 'The bot\'s RSA public key',
'method_account.acceptAuthorization_param_value_hashes_type_Vector t' => 'Hashes of the encrypted credentials',
'method_account.acceptAuthorization_param_credentials_type_SecureCredentialsEncrypted' => 'Encrypted secure credentials',
'method_account.sendVerifyPhoneCode' => 'Send phone verification code',
'method_account.sendVerifyPhoneCode_param_allow_flashcall_type_true' => 'Allow phone calls?',
'method_account.sendVerifyPhoneCode_param_phone_number_type_string' => 'The phone number',
'method_account.sendVerifyPhoneCode_param_current_number_type_Bool' => 'Is this the current number?',
'method_account.verifyPhone' => 'Verify phone number',
'method_account.verifyPhone_param_phone_number_type_string' => 'The phone number',
'method_account.verifyPhone_param_phone_code_hash_type_string' => 'The phone code hash returned by account.sendVerifyPhoneCode',
'method_account.verifyPhone_param_phone_code_type_string' => 'The phone code type returned by account.sendVerifyPhoneCode',
'method_account.sendVerifyEmailCode' => 'Send email verification code',
'method_account.sendVerifyEmailCode_param_email_type_string' => 'Email',
'method_account.verifyEmail' => 'Verify email address',
'method_account.verifyEmail_param_email_type_string' => 'The email address',
'method_account.verifyEmail_param_code_type_string' => 'The received code',
'method_users.setSecureValueErrors' => 'Set secure value error for telegram passport',
'method_users.setSecureValueErrors_param_id_type_InputUser' => 'The user ID',
'method_users.setSecureValueErrors_param_errors_type_Vector t' => 'The errors',
'method_messages.search_param_hash_type_int' => '$MadelineProto->gen_vector_hash(ids of previously fetched messages);',
'method_messages.report' => 'Report a message',
'method_messages.report_param_peer_type_InputPeer' => 'The user that sent the messages',
'method_messages.report_param_id_type_Vector t' => 'The messages to report',
'method_messages.report_param_reason_type_ReportReason' => 'The reason why you\'re sending this report',
'method_messages.getStickers_param_hash_type_int' => '$MadelineProto->gen_vector_hash(ids of previously fetched stickers, or []);',
'method_messages.editMessage_param_media_type_InputMedia' => 'The media to substitute',
'method_messages.editInlineBotMessage_param_media_type_InputMedia' => 'The media to substitute',
'method_messages.toggleDialogPin_param_peer_type_InputDialogPeer' => 'The dialog to pin',
'method_messages.getRecentLocations_param_hash_type_int' => '$MadelineProto->gen_vector_hash(ids of previously fetched locations, or []);',
'method_messages.searchStickerSets' => 'Find a sticker set',
'method_messages.searchStickerSets_param_exclude_featured_type_true' => 'Exclude featured sticker sets from the search?',
'method_messages.searchStickerSets_param_q_type_string' => 'The search query',
'method_messages.searchStickerSets_param_hash_type_int' => '$MadelineProto->gen_vector_hash(ids of previously searched stickers, or []);',
'method_upload.getFileHashes' => 'Get file hashes',
'method_upload.getFileHashes_param_location_type_InputFileLocation' => 'The file',
'method_upload.getFileHashes_param_offset_type_int' => 'Offset',
'method_help.getProxyData' => 'Get information about the current proxy',
'method_help.getTermsOfServiceUpdate' => 'Get updated TOS',
'method_help.acceptTermsOfService' => 'Accept telegram\'s TOS',
'method_help.acceptTermsOfService_param_id_type_DataJSON' => 'TOS',
'method_help.getDeepLinkInfo' => 'Get deep link info',
'method_help.getDeepLinkInfo_param_path_type_string' => 'Deep link',
'object_inputSecureFileLocation' => '',
'object_inputSecureFileLocation_param_id_type_long' => '',
'object_inputSecureFileLocation_param_access_hash_type_long' => '',
'object_messageActionBotAllowed' => '',
'object_messageActionBotAllowed_param_domain_type_string' => '',
'object_messageActionSecureValuesSentMe' => '',
'object_messageActionSecureValuesSentMe_param_values_type_Vector t' => '',
'object_messageActionSecureValuesSentMe_param_credentials_type_SecureCredentialsEncrypted' => '',
'object_messageActionSecureValuesSent' => '',
'object_messageActionSecureValuesSent_param_types_type_Vector t' => '',
'object_auth.sentCode_param_terms_of_service_type_help.TermsOfService' => '',
'object_inputPeerNotifySettings_param_silent_type_Bool' => '',
'object_peerNotifySettings_param_silent_type_Bool' => '',
'object_updateDialogPinned_param_peer_type_DialogPeer' => '',
'object_upload.fileCdnRedirect_param_file_hashes_type_Vector t' => '',
'object_dcOption_param_secret_type_bytes' => '',
'object_config_param_preload_featured_stickers_type_true' => '',
'object_config_param_ignore_phone_entities_type_true' => '',
'object_config_param_revoke_pm_inbox_type_true' => '',
'object_config_param_blocked_mode_type_true' => '',
'object_config_param_revoke_time_limit_type_int' => '',
'object_config_param_revoke_pm_time_limit_type_int' => '',
'object_config_param_autoupdate_url_prefix_type_string' => '',
'object_messages.stickers_param_hash_type_int' => '',
'object_account.noPassword_param_new_secure_salt_type_bytes' => '',
'object_account.noPassword_param_secure_random_type_bytes' => '',
'object_account.password_param_has_recovery_type_true' => '',
'object_account.password_param_has_secure_values_type_true' => '',
'object_account.password_param_new_secure_salt_type_bytes' => '',
'object_account.password_param_secure_random_type_bytes' => '',
'object_account.passwordSettings_param_secure_salt_type_bytes' => '',
'object_account.passwordSettings_param_secure_secret_type_bytes' => '',
'object_account.passwordSettings_param_secure_secret_id_type_long' => '',
'object_account.passwordInputSettings_param_new_secure_salt_type_bytes' => '',
'object_account.passwordInputSettings_param_new_secure_secret_type_bytes' => '',
'object_account.passwordInputSettings_param_new_secure_secret_id_type_long' => '',
'object_stickerSet_param_installed_date_type_int' => '',
'object_messageEntityPhone' => '',
'object_messageEntityPhone_param_offset_type_int' => '',
'object_messageEntityPhone_param_length_type_int' => '',
'object_messageEntityCashtag' => '',
'object_messageEntityCashtag_param_offset_type_int' => '',
'object_messageEntityCashtag_param_length_type_int' => '',
'object_help.termsOfService_param_popup_type_true' => '',
'object_help.termsOfService_param_id_type_DataJSON' => '',
'object_help.termsOfService_param_entities_type_Vector t' => '',
'object_help.termsOfService_param_min_age_confirm_type_int' => '',
'object_inputBotInlineMessageMediaVenue_param_venue_type_type_string' => '',
'object_inputBotInlineResult_param_thumb_type_InputWebDocument' => '',
'object_inputBotInlineResult_param_content_type_InputWebDocument' => '',
'object_botInlineMessageMediaVenue_param_venue_type_type_string' => '',
'object_botInlineResult_param_thumb_type_WebDocument' => '',
'object_botInlineResult_param_content_type_WebDocument' => '',
'object_messages.recentStickers_param_packs_type_Vector t' => '',
'object_messages.recentStickers_param_dates_type_Vector t' => '',
'object_webDocumentNoProxy' => '',
'object_webDocumentNoProxy_param_url_type_string' => '',
'object_webDocumentNoProxy_param_size_type_int' => '',
'object_webDocumentNoProxy_param_mime_type_type_string' => '',
'object_webDocumentNoProxy_param_attributes_type_Vector t' => '',
'object_inputWebFileGeoPointLocation' => '',
'object_inputWebFileGeoPointLocation_param_geo_point_type_InputGeoPoint' => '',
'object_inputWebFileGeoPointLocation_param_w_type_int' => '',
'object_inputWebFileGeoPointLocation_param_h_type_int' => '',
'object_inputWebFileGeoPointLocation_param_zoom_type_int' => '',
'object_inputWebFileGeoPointLocation_param_scale_type_int' => '',
'object_inputWebFileGeoMessageLocation' => '',
'object_inputWebFileGeoMessageLocation_param_peer_type_InputPeer' => '',
'object_inputWebFileGeoMessageLocation_param_msg_id_type_int' => '',
'object_inputWebFileGeoMessageLocation_param_w_type_int' => '',
'object_inputWebFileGeoMessageLocation_param_h_type_int' => '',
'object_inputWebFileGeoMessageLocation_param_zoom_type_int' => '',
'object_inputWebFileGeoMessageLocation_param_scale_type_int' => '',
'object_channelAdminRights_param_manage_call_type_true' => '',
'object_inputDialogPeer' => '',
'object_inputDialogPeer_param_peer_type_InputPeer' => '',
'object_dialogPeer' => '',
'object_dialogPeer_param_peer_type_Peer' => '',
'object_messages.foundStickerSetsNotModified' => '',
'object_messages.foundStickerSets' => '',
'object_messages.foundStickerSets_param_hash_type_int' => '',
'object_messages.foundStickerSets_param_sets_type_Vector t' => '',
'object_fileHash' => '',
'object_fileHash_param_offset_type_int' => '',
'object_fileHash_param_limit_type_int' => '',
'object_fileHash_param_hash_type_bytes' => '',
'object_inputClientProxy' => '',
'object_inputClientProxy_param_address_type_string' => '',
'object_inputClientProxy_param_port_type_int' => '',
'object_help.proxyDataEmpty' => '',
'object_help.proxyDataEmpty_param_expires_type_int' => '',
'object_help.proxyDataPromo' => '',
'object_help.proxyDataPromo_param_expires_type_int' => '',
'object_help.proxyDataPromo_param_peer_type_Peer' => '',
'object_help.proxyDataPromo_param_chats_type_Vector t' => '',
'object_help.proxyDataPromo_param_users_type_Vector t' => '',
'object_help.termsOfServiceUpdateEmpty' => '',
'object_help.termsOfServiceUpdateEmpty_param_expires_type_int' => '',
'object_help.termsOfServiceUpdate' => '',
'object_help.termsOfServiceUpdate_param_expires_type_int' => '',
'object_help.termsOfServiceUpdate_param_terms_of_service_type_help.TermsOfService' => '',
'object_inputSecureFileUploaded' => '',
'object_inputSecureFileUploaded_param_id_type_long' => '',
'object_inputSecureFileUploaded_param_parts_type_int' => '',
'object_inputSecureFileUploaded_param_md5_checksum_type_string' => '',
'object_inputSecureFileUploaded_param_file_hash_type_bytes' => '',
'object_inputSecureFileUploaded_param_secret_type_bytes' => '',
'object_inputSecureFile' => '',
'object_inputSecureFile_param_id_type_long' => '',
'object_inputSecureFile_param_access_hash_type_long' => '',
'object_secureFileEmpty' => '',
'object_secureFile' => '',
'object_secureFile_param_id_type_long' => '',
'object_secureFile_param_access_hash_type_long' => '',
'object_secureFile_param_size_type_int' => '',
'object_secureFile_param_dc_id_type_int' => '',
'object_secureFile_param_date_type_int' => '',
'object_secureFile_param_file_hash_type_bytes' => '',
'object_secureFile_param_secret_type_bytes' => '',
'object_secureData' => '',
'object_secureData_param_data_type_bytes' => '',
'object_secureData_param_data_hash_type_bytes' => '',
'object_secureData_param_secret_type_bytes' => '',
'object_securePlainPhone' => '',
'object_securePlainPhone_param_phone_type_string' => '',
'object_securePlainEmail' => '',
'object_securePlainEmail_param_email_type_string' => '',
'object_secureValueTypePersonalDetails' => '',
'object_secureValueTypePassport' => '',
'object_secureValueTypeDriverLicense' => '',
'object_secureValueTypeIdentityCard' => '',
'object_secureValueTypeInternalPassport' => '',
'object_secureValueTypeAddress' => '',
'object_secureValueTypeUtilityBill' => '',
'object_secureValueTypeBankStatement' => '',
'object_secureValueTypeRentalAgreement' => '',
'object_secureValueTypePassportRegistration' => '',
'object_secureValueTypeTemporaryRegistration' => '',
'object_secureValueTypePhone' => '',
'object_secureValueTypeEmail' => '',
'object_secureValue' => '',
'object_secureValue_param_type_type_SecureValueType' => '',
'object_secureValue_param_data_type_SecureData' => '',
'object_secureValue_param_front_side_type_SecureFile' => '',
'object_secureValue_param_reverse_side_type_SecureFile' => '',
'object_secureValue_param_selfie_type_SecureFile' => '',
'object_secureValue_param_files_type_Vector t' => '',
'object_secureValue_param_plain_data_type_SecurePlainData' => '',
'object_secureValue_param_hash_type_bytes' => '',
'object_inputSecureValue' => '',
'object_inputSecureValue_param_type_type_SecureValueType' => '',
'object_inputSecureValue_param_data_type_SecureData' => '',
'object_inputSecureValue_param_front_side_type_InputSecureFile' => '',
'object_inputSecureValue_param_reverse_side_type_InputSecureFile' => '',
'object_inputSecureValue_param_selfie_type_InputSecureFile' => '',
'object_inputSecureValue_param_files_type_Vector t' => '',
'object_inputSecureValue_param_plain_data_type_SecurePlainData' => '',
'object_secureValueHash' => '',
'object_secureValueHash_param_type_type_SecureValueType' => '',
'object_secureValueHash_param_hash_type_bytes' => '',
'object_secureValueErrorData' => '',
'object_secureValueErrorData_param_type_type_SecureValueType' => '',
'object_secureValueErrorData_param_data_hash_type_bytes' => '',
'object_secureValueErrorData_param_field_type_string' => '',
'object_secureValueErrorData_param_text_type_string' => '',
'object_secureValueErrorFrontSide' => '',
'object_secureValueErrorFrontSide_param_type_type_SecureValueType' => '',
'object_secureValueErrorFrontSide_param_file_hash_type_bytes' => '',
'object_secureValueErrorFrontSide_param_text_type_string' => '',
'object_secureValueErrorReverseSide' => '',
'object_secureValueErrorReverseSide_param_type_type_SecureValueType' => '',
'object_secureValueErrorReverseSide_param_file_hash_type_bytes' => '',
'object_secureValueErrorReverseSide_param_text_type_string' => '',
'object_secureValueErrorSelfie' => '',
'object_secureValueErrorSelfie_param_type_type_SecureValueType' => '',
'object_secureValueErrorSelfie_param_file_hash_type_bytes' => '',
'object_secureValueErrorSelfie_param_text_type_string' => '',
'object_secureValueErrorFile' => '',
'object_secureValueErrorFile_param_type_type_SecureValueType' => '',
'object_secureValueErrorFile_param_file_hash_type_bytes' => '',
'object_secureValueErrorFile_param_text_type_string' => '',
'object_secureValueErrorFiles' => '',
'object_secureValueErrorFiles_param_type_type_SecureValueType' => '',
'object_secureValueErrorFiles_param_file_hash_type_Vector t' => '',
'object_secureValueErrorFiles_param_text_type_string' => '',
'object_secureCredentialsEncrypted' => '',
'object_secureCredentialsEncrypted_param_data_type_bytes' => '',
'object_secureCredentialsEncrypted_param_hash_type_bytes' => '',
'object_secureCredentialsEncrypted_param_secret_type_bytes' => '',
'object_account.authorizationForm' => '',
'object_account.authorizationForm_param_selfie_required_type_true' => '',
'object_account.authorizationForm_param_required_types_type_Vector t' => '',
'object_account.authorizationForm_param_values_type_Vector t' => '',
'object_account.authorizationForm_param_errors_type_Vector t' => '',
'object_account.authorizationForm_param_users_type_Vector t' => '',
'object_account.authorizationForm_param_privacy_policy_url_type_string' => '',
'object_account.sentEmailCode' => '',
'object_account.sentEmailCode_param_email_pattern_type_string' => '',
'object_account.sentEmailCode_param_length_type_int' => '',
'object_help.deepLinkInfoEmpty' => '',
'object_help.deepLinkInfo' => '',
'object_help.deepLinkInfo_param_update_app_type_true' => '',
'object_help.deepLinkInfo_param_message_type_string' => '',
'object_help.deepLinkInfo_param_entities_type_Vector t' => '',
'method_invokeWithMessagesRange' => 'Invoke with messages range',
'method_invokeWithMessagesRange_param_range_type_MessageRange' => 'The range',
'method_invokeWithMessagesRange_param_query_type_!X' => 'The query',
'method_invokeWithTakeout' => 'Invoke method from takeout session',
'method_invokeWithTakeout_param_takeout_id_type_long' => 'The takeout session ID',
'method_invokeWithTakeout_param_query_type_!X' => 'The query',
'method_account.initTakeoutSession' => 'Start account exporting session',
'method_account.initTakeoutSession_param_contacts_type_true' => 'Export contacts?',
'method_account.initTakeoutSession_param_message_users_type_true' => 'Export users?',
'method_account.initTakeoutSession_param_message_chats_type_true' => 'Export chats?',
'method_account.initTakeoutSession_param_message_megagroups_type_true' => 'Export supergroups?',
'method_account.initTakeoutSession_param_message_channels_type_true' => 'Export channel messages?',
'method_account.initTakeoutSession_param_files_type_true' => 'Export files?',
'method_account.initTakeoutSession_param_file_max_size_type_int' => 'Export only files smaller than this size',
'method_account.finishTakeoutSession' => 'Finish account exporting session',
'method_account.finishTakeoutSession_param_success_type_true' => 'Did the data export succeed?',
'method_contacts.getSaved' => 'Get saved contacts',
'method_messages.getSplitRanges' => 'Get message ranges to fetch',
'method_channels.getLeftChannels' => 'Get all channels you left',
'method_channels.getLeftChannels_param_offset_type_int' => 'Offset',
'object_ipPortSecret' => '',
'object_ipPortSecret_param_ipv4_type_int' => '',
'object_ipPortSecret_param_port_type_int' => '',
'object_ipPortSecret_param_secret_type_bytes' => '',
'object_accessPointRule' => '',
'object_accessPointRule_param_phone_prefix_rules_type_string' => '',
'object_accessPointRule_param_dc_id_type_int' => '',
'object_accessPointRule_param_ips_type_vector' => '',
'object_help.configSimple_param_rules_type_vector' => '',
'object_inputTakeoutFileLocation' => '',
'object_savedPhoneContact' => '',
'object_savedPhoneContact_param_phone_type_string' => '',
'object_savedPhoneContact_param_first_name_type_string' => '',
'object_savedPhoneContact_param_last_name_type_string' => '',
'object_savedPhoneContact_param_date_type_int' => '',
'object_account.takeout' => '',
'object_account.takeout_param_id_type_long' => '',
);
}
}

View File

@ -49,12 +49,12 @@ class Logger
* 4 - Call callable provided in logger_param. logger_param must accept two parameters: array $message, int $level
* $message is an array containing the messages the log, $level, is the logging level
*/
public static function constructor($mode, $optional = null, $prefix = '', $level = self::NOTICE)
public static function constructor($mode, $optional = null, $prefix = '', $level = self::NOTICE, $max_size = 100*1024*1024)
{
self::$default = new self($mode, $optional, $prefix, $level);
self::$default = new self($mode, $optional, $prefix, $level, $max_size);
}
public function __construct($mode, $optional = null, $prefix = '', $level = self::NOTICE)
public function __construct($mode, $optional, $prefix, $level, $max_size)
{
if ($mode === null) {
throw new Exception(\danog\MadelineProto\Lang::$current_lang['no_mode_specified']);
@ -64,6 +64,10 @@ class Logger
$this->prefix = $prefix === '' ? '' : ', '.$prefix;
$this->level = $level;
if ($mode === 2 && $max_size !== -1 && file_exists($this->optional) && filesize($this->optional) > $max_size) {
unlink($this->optional);
}
$this->colors[self::ULTRA_VERBOSE] = implode(';', [self::foreground['light_gray'], self::set['dim']]);
$this->colors[self::VERBOSE] = implode(';', [self::foreground['green'], self::set['bold']]);
$this->colors[self::NOTICE] = implode(';', [self::foreground['yellow'], self::set['bold']]);

View File

@ -51,11 +51,12 @@ class MTProto
use \danog\MadelineProto\Wrappers\Noop;
use \danog\MadelineProto\Wrappers\Start;
use \danog\MadelineProto\Wrappers\Templates;
use \danog\MadelineProto\Wrappers\TOS;
/*
const V = 71;
*/
const V = 100;
const V = 102;
const NOT_LOGGED_IN = 0;
const WAITING_CODE = 1;
const WAITING_SIGNUP = -1;
@ -74,6 +75,7 @@ class MTProto
public $hook_url = false;
public $settings = [];
private $config = ['expires' => -1];
private $tos = ['expires' => 0, 'accepted' => true];
private $initing_authorization = false;
public $authorization = null;
public $authorized = 0;
@ -152,7 +154,7 @@ class MTProto
public function __sleep()
{
return ['event_handler', 'event_handler_instance', 'loop_callback', 'web_template', 'encrypted_layer', 'settings', 'config', 'authorization', 'authorized', 'rsa_keys', 'last_recv', 'dh_config', 'chats', 'last_stored', 'qres', 'pending_updates', 'pending_pwrchat', 'postpone_pwrchat', 'updates_state', 'got_state', 'channels_state', 'updates', 'updates_key', 'full_chats', 'msg_ids', 'dialog_params', 'datacenter', 'v', 'constructors', 'td_constructors', 'methods', 'td_methods', 'td_descriptions', 'temp_requested_secret_chats', 'temp_rekeyed_secret_chats', 'secret_chats', 'hook_url', 'storage', 'authorized_dc'];
return ['event_handler', 'event_handler_instance', 'loop_callback', 'web_template', 'encrypted_layer', 'settings', 'config', 'authorization', 'authorized', 'rsa_keys', 'last_recv', 'dh_config', 'chats', 'last_stored', 'qres', 'pending_updates', 'pending_pwrchat', 'postpone_pwrchat', 'updates_state', 'got_state', 'channels_state', 'updates', 'updates_key', 'full_chats', 'msg_ids', 'dialog_params', 'datacenter', 'v', 'constructors', 'td_constructors', 'methods', 'td_methods', 'td_descriptions', 'temp_requested_secret_chats', 'temp_rekeyed_secret_chats', 'secret_chats', 'hook_url', 'storage', 'authorized_dc', 'tos'];
}
public function __wakeup()
@ -455,12 +457,12 @@ class MTProto
'lang_code' => $lang_code,
], 'tl_schema' => [
// TL scheme files
'layer' => 75,
'layer' => 81,
// layer version
'src' => [
'mtproto' => __DIR__.'/TL_mtproto_v1.json',
// mtproto TL scheme
'telegram' => __DIR__.'/TL_telegram_v75.tl',
'telegram' => __DIR__.'/TL_telegram_v81.tl',
// telegram TL scheme
'secret' => __DIR__.'/TL_secret.tl',
// secret chats TL scheme
@ -485,6 +487,7 @@ class MTProto
'logger' => php_sapi_name() === 'cli' ? 3 : 2,
// overwrite previous setting and echo logs
'logger_level' => Logger::VERBOSE,
'max_size' => 100*1024*1024,
// Logging level, available logging levels are: ULTRA_VERBOSE, VERBOSE, NOTICE, WARNING, ERROR, FATAL_ERROR. Can be provided as last parameter to the logging function.
'rollbar_token' => '',
], 'max_tries' => [
@ -573,9 +576,9 @@ class MTProto
Exception::$rollbar = false;
RPCErrorException::$rollbar = false;
}
$this->logger = new \danog\MadelineProto\Logger($this->settings['logger']['logger'], isset($this->settings['logger']['logger_param']) ? $this->settings['logger']['logger_param'] : '', isset($this->authorization['user']) ? isset($this->authorization['user']['username']) ? $this->authorization['user']['username'] : $this->authorization['user']['id'] : '', isset($this->settings['logger']['logger_level']) ? $this->settings['logger']['logger_level'] : Logger::VERBOSE);
$this->logger = new \danog\MadelineProto\Logger($this->settings['logger']['logger'], isset($this->settings['logger']['logger_param']) ? $this->settings['logger']['logger_param'] : '', isset($this->authorization['user']) ? isset($this->authorization['user']['username']) ? $this->authorization['user']['username'] : $this->authorization['user']['id'] : '', isset($this->settings['logger']['logger_level']) ? $this->settings['logger']['logger_level'] : Logger::VERBOSE, isset($this->settings['logger']['max_size']) ? $this->settings['logger']['max_size'] : 100*1024*1024);
if (!\danog\MadelineProto\Logger::$default) {
\danog\MadelineProto\Logger::constructor($this->settings['logger']['logger'], $this->settings['logger']['logger_param'], isset($this->authorization['user']) ? isset($this->authorization['user']['username']) ? $this->authorization['user']['username'] : $this->authorization['user']['id'] : '', isset($this->settings['logger']['logger_level']) ? $this->settings['logger']['logger_level'] : Logger::VERBOSE);
\danog\MadelineProto\Logger::constructor($this->settings['logger']['logger'], $this->settings['logger']['logger_param'], isset($this->authorization['user']) ? isset($this->authorization['user']['username']) ? $this->authorization['user']['username'] : $this->authorization['user']['id'] : '', isset($this->settings['logger']['logger_level']) ? $this->settings['logger']['logger_level'] : Logger::VERBOSE, isset($this->settings['logger']['max_size']) ? $this->settings['logger']['max_size'] : 100*1024*1024);
}
}

View File

@ -38,10 +38,10 @@ trait AuthKeyHandler
* ]
*
* @return ResPQ [
* int128 $nonce : The value of nonce is selected randomly by the server
* int128 $server_nonce : The value of server_nonce is selected randomly by the server
* string $pq : This is a representation of a natural number (in binary big endian format). This number is the product of two different odd prime numbers
* Vector long $server_public_key_fingerprints : This is a list of public RSA key fingerprints
* int128 $nonce : The value of nonce is selected randomly by the server
* int128 $server_nonce : The value of server_nonce is selected randomly by the server
* string $pq : This is a representation of a natural number (in binary big endian format). This number is the product of two different odd prime numbers
* Vector long $server_public_key_fingerprints : This is a list of public RSA key fingerprints
* ]
*/
$nonce = $this->random(16);
@ -496,7 +496,6 @@ trait AuthKeyHandler
$encrypted_data = $this->random(16).$message_id.pack('VV', $seq_no, strlen($message_data)).$message_data;
$message_key = substr(sha1($encrypted_data, true), -16);
$padding = $this->random($this->posmod(-strlen($encrypted_data), 16));
//$message_key = substr(hash('sha256', substr($this->datacenter->sockets[$datacenter]->auth_key['auth_key'], 88, 32).$encrypted_data.$padding, true), 8, 16);
list($aes_key, $aes_iv) = $this->old_aes_calculate($message_key, $this->datacenter->sockets[$datacenter]->auth_key['auth_key']);
$encrypted_message = $this->datacenter->sockets[$datacenter]->auth_key['id'].$message_key.$this->ige_encrypt($encrypted_data.$padding, $aes_key, $aes_iv);
$res = $this->method_call('auth.bindTempAuthKey', ['perm_auth_key_id' => $perm_auth_key_id, 'nonce' => $nonce, 'expires_at' => $expires_at, 'encrypted_message' => $encrypted_message], ['message_id' => $message_id, 'datacenter' => $datacenter]);
@ -578,6 +577,7 @@ trait AuthKeyHandler
$this->updates_state['sync_loading'] = false;
$this->handle_pending_updates();
}
}
public function sync_authorization($id)

View File

@ -510,11 +510,6 @@ trait UpdateHandler
public function save_update($update)
{
array_walk($this->calls, function ($controller, $id) {
if ($controller->getCallState() === \danog\MadelineProto\VoIP::CALL_STATE_ENDED) {
$controller->discard();
}
});
if ($update['_'] === 'updateDcOptions') {
$this->logger->logger('Got new dc options', \danog\MadelineProto\Logger::VERBOSE);
$this->parse_dc_options($update['dc_options']);

View File

@ -24,7 +24,6 @@ class RSA
public function __magic_construct($rsa_key)
{
//if ($this->unserialized($rsa_key)) return true;
\danog\MadelineProto\Logger::log(\danog\MadelineProto\Lang::$current_lang['rsa_init'], Logger::ULTRA_VERBOSE);
$key = new \phpseclib\Crypt\RSA();
\danog\MadelineProto\Logger::log(\danog\MadelineProto\Lang::$current_lang['loading_key'], Logger::ULTRA_VERBOSE);

View File

@ -133,6 +133,7 @@ trait TL
$key++;
}
} else {
foreach ($TL_dict['constructors'] as $key => $value) {
$TL_dict['constructors'][$key]['id'] = $this->pack_signed_int($TL_dict['constructors'][$key]['id']);
}
@ -140,6 +141,7 @@ trait TL
$TL_dict['methods'][$key]['id'] = $this->pack_signed_int($TL_dict['methods'][$key]['id']);
}
}
if (empty($TL_dict) || empty($TL_dict['constructors']) || !isset($TL_dict['methods'])) {
throw new Exception(\danog\MadelineProto\Lang::$current_lang['src_file_invalid'].$file);
}
@ -312,6 +314,9 @@ trait TL
if (!is_array($object)) {
throw new Exception(\danog\MadelineProto\Lang::$current_lang['array_invalid']);
}
if (isset($object['_'])) {
throw new Exception('You must provide an array of '.$type['subtype']." objects, not a ".$type['subtype']." object. Example: [['_' => ".$type['subtype'].", ... ]]");
}
$concat = $this->constructors->find_by_predicate('vector')['id'];
$concat .= $this->pack_unsigned_int(count($object));
foreach ($object as $k => $current_object) {
@ -597,7 +602,7 @@ trait TL
stream_get_contents($stream, $resto);
}
} else {
$x = stream_get_contents($stream, $l);
$x = $l ? stream_get_contents($stream, $l) : '';
$resto = $this->posmod(-($l + 1), 4);
if ($resto > 0) {
stream_get_contents($stream, $resto);

View File

@ -18,9 +18,9 @@ trait TLParams
public function parse_params($key, $mtproto = false)
{
foreach ($this->by_id[$key]['params'] as $kkey => $param) {
if (preg_match('/^flags\.(\d*)\?(.*)/', $param['type'], $matches)) {
$param['pow'] = pow(2, $matches[1]);
$param['type'] = $matches[2];
if (preg_match('/(\w*)\.(\d*)\?(.*)/', $param['type'], $matches)) {
$param['pow'] = pow(2, $matches[2]);
$param['type'] = $matches[3];
}
if (preg_match('/^(v|V)ector\<(.*)\>$/', $param['type'], $matches)) {
$param['type'] = $matches[1] === 'v' ? 'vector' : 'Vector t';

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,9 @@ trait ApiStart
return $line;
}
}
if (strpos($res = readline('You did not define a valid API ID/API hash. Do you want to define it now manually, or automatically? (m/a): '), 'm') !== false) {
echo 'You did not define a valid API ID/API hash. Do you want to define it now manually, or automatically? (m/a)
Note that you can also provide the API parameters directly in the code using the settings: https://docs.madelineproto.xyz/docs/SETTINGS.html#settingsapp_infoapi_id'.PHP_EOL;
if (strpos($res = readline('Your choice (m/a): '), 'm') !== false) {
echo '1) Login to my.telegram.org
2) Go to API development tools
3) App title: your app\'s name, can be anything

View File

@ -67,7 +67,7 @@ trait ApiTemplates
echo $this->web_api_echo_template('Enter your phone number<br><b>'.$message.'</b>', '<input type="text" name="phone_number" placeholder="Phone number" required/>');
}
} else {
echo $this->web_api_echo_template('Do you want to enter the API id and the API hash manually or automatically?<br><b>'.$message.'</b>', '<select name="type"><option value="automatic">Automatically</option><option value="manual">Manually</option></select>');
echo $this->web_api_echo_template('Do you want to enter the API id and the API hash manually or automatically?<br>Note that you can also provide it directly in the code using the <a href="https://docs.madelineproto.xyz/docs/SETTINGS.html#settingsapp_infoapi_id">settings</a>.<b>'.$message.'</b>', '<select name="type"><option value="automatic">Automatically</option><option value="manual">Manually</option></select>');
}
} else {
echo $this->web_api_echo_template('Enter your code<br><b>'.$message.'</b>', '<input type="text" name="code" placeholder="Code" required/>');

View File

@ -31,6 +31,7 @@ trait Login
$this->chats = [];
$this->users = [];
$this->state = [];
$this->tos = ['expires' => 0, 'accepted' => true];
if (!$this->method_call('auth.logOut', [], ['datacenter' => $this->datacenter->curdc])) {
throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['logout_error']);
}

View File

@ -0,0 +1,55 @@
<?php
/*
Copyright 2016-2018 Daniil Gentili
(https://daniil.it)
This file is part of MadelineProto.
MadelineProto is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
MadelineProto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
You should have received a copy of the GNU General Public License along with MadelineProto.
If not, see <http://www.gnu.org/licenses/>.
*/
namespace danog\MadelineProto\Wrappers;
/**
* Manages logging in and out.
*/
trait TOS
{
public function check_tos()
{
if ($this->authorized === self::LOGGED_IN) {
if ($this->tos['expires'] < time()) {
$this->logger->logger('Fetching TOS...');
$this->tos = $this->method_call('help.getTermsOfServiceUpdate', [], ['datacenter' => $this->datacenter->curdc]);
$this->tos['accepted'] = $this->tos['_'] === 'help.termsOfServiceUpdateEmpty';
}
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('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);
throw new \danog\MadelineProto\Exception('TOS action required, check the logs', 0, null, 'MadelineProto', 1);
}
}
}
public function accept_tos()
{
$this->tos['accepted'] = $this->method_call('help.acceptTermsOfService', ['id' => $this->tos['terms_of_service']['id']], ['datacenter' => $this->datacenter->curdc]);
if ($this->tos['accepted']) {
$this->logger->logger('TOS accepted successfully');
} else {
throw new \danog\MadelineProto\Exception('An error occurred while accepting the TOS');
}
}
public function decline_tos()
{
$this->method_call('account.deleteAccount', ['reason' => 'Decline ToS update'], ['datacenter' => $this->datacenter->curdc]);
$this->logout();
}
}

View File

@ -45,6 +45,14 @@ echo 'Loading MadelineProto...'.PHP_EOL;
$MadelineProto = new \danog\MadelineProto\API(getcwd().'/testing.madeline', $settings);
try {
$MadelineProto->get_self();
} catch (\danog\MadelineProto\Exception $e) {
if ($e->getMessage() === 'TOS action required, check the logs') {
$MadelineProto->accept_tos();
}
}
/*
* If this session is not logged in, login
*/

View File

@ -34,6 +34,7 @@ if (!isset(\danog\MadelineProto\Lang::$lang[$lang_code])) {
}
$count = count(\danog\MadelineProto\Lang::$lang[$lang_code]);
$curcount = 0;
ksort(\danog\MadelineProto\Lang::$current_lang);
foreach (\danog\MadelineProto\Lang::$current_lang as $key => $value) {
if (!isset(\danog\MadelineProto\Lang::$lang[$lang_code][$key])) {
\danog\MadelineProto\Lang::$lang[$lang_code][$key] = $value;