From 69f33dce34747605f2fb4f3f1ac9e7eb08242031 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 16 Jun 2020 17:52:55 +0200 Subject: [PATCH] Layer 113 --- README.md | 102 +- composer.json | 7 +- docs | 2 +- examples/bot.php | 2 - examples/downloadRenameBot.php | 10 +- schemas | 2 +- .../MadelineProto/AbstractAPIFactory.php | 2 +- .../MadelineProto/AnnotationsBuilder.php | 6 +- .../MadelineProto/Db/ArrayCacheTrait.php | 25 +- src/danog/MadelineProto/Db/DbArray.php | 2 +- .../MadelineProto/Db/DbPropertiesFabric.php | 7 +- .../MadelineProto/Db/DbPropertiesTrait.php | 9 +- src/danog/MadelineProto/Db/DbType.php | 4 +- src/danog/MadelineProto/Db/MemoryArray.php | 14 +- src/danog/MadelineProto/Db/Mysql.php | 9 +- src/danog/MadelineProto/Db/MysqlArray.php | 93 +- src/danog/MadelineProto/DocsBuilder.php | 592 +------ .../DocsBuilder/Constructors.php | 136 +- .../MadelineProto/DocsBuilder/Methods.php | 225 +-- src/danog/MadelineProto/InternalDoc.php | 657 +++++--- src/danog/MadelineProto/MTProto.php | 32 +- .../MTProtoTools/GarbageCollector.php | 88 +- .../MTProtoTools/PeerHandler.php | 2 +- src/danog/MadelineProto/RPCErrorException.php | 2 +- src/danog/MadelineProto/StrTools.php | 88 + .../Stream/Common/BufferedRawStream.php | 6 +- .../Stream/Common/UdpBufferedStream.php | 5 +- src/danog/MadelineProto/TL_botAPI.tl | 19 + src/danog/MadelineProto/TL_mtproto_v1.tl | 86 + src/danog/MadelineProto/TL_secret.tl | 76 + src/danog/MadelineProto/TL_telegram_v113.tl | 1469 +++++++++++++++++ src/danog/MadelineProto/TON/InternalDoc.php | 44 +- src/danog/MadelineProto/Tools.php | 40 +- tools/build_docs.php | 98 +- tools/build_docs/layerUpgrade.php | 46 + tools/build_docs/merge.php | 25 + tools/build_docs/schemas.php | 63 + tools/merge.php | 16 - tools/static.php | 8 +- 39 files changed, 2683 insertions(+), 1436 deletions(-) create mode 100644 src/danog/MadelineProto/StrTools.php create mode 100644 src/danog/MadelineProto/TL_botAPI.tl create mode 100644 src/danog/MadelineProto/TL_mtproto_v1.tl create mode 100644 src/danog/MadelineProto/TL_secret.tl create mode 100644 src/danog/MadelineProto/TL_telegram_v113.tl create mode 100644 tools/build_docs/layerUpgrade.php create mode 100644 tools/build_docs/merge.php create mode 100644 tools/build_docs/schemas.php delete mode 100644 tools/merge.php diff --git a/README.md b/README.md index 9a97212b..f11c3399 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,8 @@ You can find examples for nearly every MadelineProto function in * [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) + * Accept QR code login token, logging in the app that generated it: auth.acceptLoginToken + * Accept incoming call: phone.acceptCall * Accept the new terms of service: help.acceptTermsOfService * Add GIF to saved gifs list: messages.saveGif * Add a sticker to a stickerset, bots only. The sticker set must have been created by the bot: stickers.addStickerToSet @@ -200,11 +202,14 @@ You can find examples for nearly every MadelineProto function in * Adds the user to the blacklist: contacts.block * Answer an inline query, for bots only: messages.setInlineBotResults * Answers a custom query; for bots only: bots.answerWebhookJSONQuery + * Apply changes to multiple stickersets: messages.toggleStickerSets * Associate a group to a channel as discussion group for that channel: channels.setDiscussionGroup * Associate a stickerset to the supergroup: channels.setStickers * Ban/unban/kick a user in a supergroup/channel: channels.editBanned + * Binds a temporary authorization key temp_auth_key_id to the permanent authorization key perm_auth_key_id. Each permanent key may only be bound to one temporary key at a time, binding a new temporary key overwrites the previous one: auth.bindTempAuthKey * Cancel the code that was sent to verify an email to use as 2FA recovery method: account.cancelPasswordEmail * Cancel the login verification code: auth.cancelCode + * Cancels a request for creation and/or delete info on secret chat: messages.discardEncryption * Chanages chat name and sends a service message on it: messages.editChatTitle * Change media autodownload settings: account.saveAutoDownloadSettings * Change privacy settings of current account: account.setPrivacy @@ -220,14 +225,16 @@ You can find examples for nearly every MadelineProto function in * Clear recent stickers: messages.clearRecentStickers * Clear saved payment information: payments.clearSavedInfo * Confirm a phone number to cancel account deletion, for more info click here »: account.confirmPhone + * Confirms creation of a secret chat: messages.acceptEncryption * Confirms receipt of messages by a client, cancels PUSH-notification sending: messages.receivedMessages + * Confirms receipt of messages in a secret chat by client, cancels push notifications: messages.receivedQueue * Create a supergroup/channel: channels.createChannel * Create a stickerset, bots only: stickers.createStickerSet * Create a theme: account.createTheme * Create and upload a new wallpaper: account.uploadWallPaper * Creates a new chat: messages.createChat * Delete a channel/supergroup: channels.deleteChannel - * Delete a folder: folders.deleteFolder + * Delete a peer folder: folders.deleteFolder * Delete all messages sent by a certain user in a supergroup: channels.deleteUserHistory * Delete all temporary authorization keys except for the ones specified: auth.dropTempAuthKeys * Delete contacts by phone number: contacts.deleteByPhones @@ -245,10 +252,11 @@ You can find examples for nearly every MadelineProto function in * Deletes profile photos: photos.deletePhotos * Deletes several contacts from the list: contacts.deleteContacts * Deletes the user from the blacklist: contacts.unblock + * Download a CDN file: upload.getCdnFile * Edit an inline bot message: messages.editInlineBotMessage * Edit location of geogroup: channels.editLocation * Edit message: messages.editMessage - * Edit peers in folder: folders.editPeerFolders + * Edit peers in peer folder: folders.editPeerFolders * Edit the default banned rights of a channel/supergroup/group: messages.editChatDefaultBannedRights * Edit the description of a group/supergroup/channel: messages.editChatAbout * Edit the name of a channel/supergroup: channels.editTitle @@ -259,10 +267,17 @@ You can find examples for nearly every MadelineProto function in * Find out if a media message's caption can be edited: messages.getMessageEditData * Finish account takeout session: account.finishTakeoutSession * Forwards messages by their IDs: messages.forwardMessages + * Generate a login token, for login via QR code. : auth.exportLoginToken + * Get MTProxy/Public Service Announcement information: help.getPromoData + * Get SHA256 hashes for verifying downloaded CDN files: upload.getCdnFileHashes + * Get SHA256 hashes for verifying downloaded files: upload.getFileHashes + * Get channel statistics: stats.getBroadcastStats * Get channel/supergroup messages: channels.getMessages * Get channels/supergroups/geogroups we're admin in. Usually called when the user exceeds the limit for owned public channels/supergroups/geogroups, and the user is given the choice to remove one of his channels/supergroups/geogroups: channels.getAdminedPublicChannels + * Get folders: messages.getDialogFilters * Get instant view page: messages.getWebPage * Get passport configuration: help.getPassportConfig + * Get suggested folders: messages.getSuggestedDialogFilters * Get a document by its SHA256 hash, mainly used for gifs: messages.getDocumentByHash * Get a list of channels/supergroups we left: channels.getLeftChannels * Get a payment form: payments.getPaymentForm @@ -273,9 +288,9 @@ You can find examples for nearly every MadelineProto function in * Get all installed stickers: messages.getAllStickers * Get all saved Telegram Passport documents, for more info see the passport docs »: account.getAllSecureValues * Get and increase the view counter of a message sent or forwarded from a channel: messages.getMessagesViews - * Get app-specific configuration: help.getAppConfig + * Get app-specific configuration, see client configuration for more info on the result: help.getAppConfig * Get changed emoji keywords: messages.getEmojiKeywordsDifference - * Get changelog of current app: help.getAppChangelog + * Get changelog of current app. : help.getAppChangelog * Get chats in common with a user: messages.getCommonChats * Get configuration for CDN file downloads: help.getCdnConfig * Get contact by telegram IDs: contacts.getContactIDs @@ -286,14 +301,18 @@ You can find examples for nearly every MadelineProto function in * Get dialogs manually marked as unread: messages.getDialogUnreadMarks * Get faved stickers: messages.getFavedStickers * Get featured stickers: messages.getFeaturedStickers + * Get full info about a channel: channels.getFullChannel * Get highscores of a game sent using an inline bot: messages.getInlineGameHighScores * Get highscores of a game: messages.getGameHighScores + * Get inactive channels and supergroups: channels.getInactiveChannels * Get info about channels/supergroups: channels.getChannels * Get info about a channel/supergroup participant: channels.getParticipant * Get info about a t.me link: help.getDeepLinkInfo * Get info about a certain wallpaper: account.getWallPaper + * Get info about a credit card: payments.getBankCardData * Get info about a stickerset: messages.getStickerSet * Get info about an emoji keyword localization: messages.getEmojiKeywordsLanguages + * Get info about multiple wallpapers: account.getMultiWallPapers * Get information about a language in a localization pack: langpack.getLanguage * Get information about all languages in a localization pack: langpack.getLanguages * Get installed mask stickers: messages.getMaskStickers @@ -308,15 +327,17 @@ You can find examples for nearly every MadelineProto function in * Get message ranges for saving the user's chat history: messages.getSplitRanges * Get more info about a Seamless Telegram Login authorization request, for more info click here »: messages.requestUrlAuth * Get most used peers: contacts.getTopPeers + * Get new updates: updates.getDifference * Get new strings in languagepack: langpack.getDifference * Get payment receipt: payments.getPaymentReceipt * Get peer settings: messages.getPeerSettings * Get phone call configuration to be passed to libtgvoip's shared config: phone.getCallConfig * Get pinned dialogs: messages.getPinnedDialogs + * Get poll results for non-anonymous polls: messages.getPollVotes * Get poll results: messages.getPollResults * Get preview of webpage: messages.getWebPagePreview * Get privacy settings of current account: account.getPrivacy - * Get promotion info of the currently-used MTProxy: help.getProxyData + * Get private info associated to the password info (recovery email, telegram passport info & so on): account.getPasswordSettings * Get recent stickers: messages.getRecentStickers * Get recently used t.me links: help.getRecentMeUrls * Get saved GIFs: messages.getSavedGifs @@ -324,6 +345,7 @@ You can find examples for nearly every MadelineProto function in * Get saved payment information: payments.getSavedInfo * Get scheduled messages: messages.getScheduledHistory * Get scheduled messages: messages.getScheduledMessages + * Get sensitive content settings: account.getContentSettings * Get stickers attached to a photo or video: messages.getAttachedStickers * Get stickers by emoji: messages.getStickers * Get strings from a language pack: langpack.getStrings @@ -337,6 +359,7 @@ You can find examples for nearly every MadelineProto function in * Gets back found messages: messages.search * Gets back the conversation history with one interlocutor / within a chat: messages.getHistory * Gets current notification settings for a given user/group, from all users/all groups: account.getNotifySettings + * Hide MTProxy/Public Service Announcement information: help.hidePromoData * Hide/unhide message history for new channel/supergroup users: channels.togglePreHistoryHidden * If the peer settings of a new user allow us to add him as contact, add that user as contact: contacts.acceptContact * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the bot will receive an updateBotShippingQuery update. Use this method to reply to shipping queries: messages.setBotShippingResults @@ -361,8 +384,13 @@ You can find examples for nearly every MadelineProto function in * Invokes a query after successfull completion of one of the previous queries: invokeAfterMsg * Join a channel/supergroup: channels.joinChannel * Leave a channel/supergroup: channels.leaveChannel + * Load channel statistics graph asynchronously: stats.loadAsyncGraph * Log out an active authorized session by its hash: account.resetAuthorization * Log out an active web telegram login session: account.resetWebAuthorization + * Login as a bot: auth.importBotAuthorization + * Login using a redirected login token, generated in case of DC mismatch during QR code login: auth.importLoginToken + * Logs in a user using a key transmitted from his native data-centre: auth.importAuthorization + * Logs out the user: auth.logOut * Look for updates of telegram's terms of service: help.getTermsOfServiceUpdate * Make a user admin in a legacy group: messages.editChatAdmin * Manually mark dialog as unread: messages.markDialogUnread @@ -373,6 +401,7 @@ You can find examples for nearly every MadelineProto function in * Mark new featured stickers as read: messages.readFeaturedStickers * Marks message history as read: messages.readHistory * Marks message history within a secret chat as read: messages.readEncryptedHistory + * Method for fetching previously featured stickers: messages.getOldFeaturedStickers * Modify the admin rights of a user in a supergroup/channel: channels.editAdmin * Notifies the sender about the recipient having listened a voice message or watched a video: messages.readMessageContents * Notify the other user in a private chat that a screenshot of the chat was taken: messages.sendScreenshotNotification @@ -385,8 +414,11 @@ You can find examples for nearly every MadelineProto function in * Press an inline callback button and get a callback answer from the bot: messages.getBotCallbackAnswer * Query an inline bot: messages.getInlineBotResults * Rate a call: phone.setCallRating + * Refuse or end running call: phone.discardCall * Register device to receive PUSH notifications: account.registerDevice + * Registers a validated phone number in the system: auth.signUp * Remove a sticker from the set where it belongs, bots only. The sticker set must have been created by the bot: stickers.removeStickerFromSet + * Reorder folders: messages.updateDialogFiltersOrder * Reorder installed stickersets: messages.reorderStickerSets * Reorder pinned dialogs: messages.reorderPinnedDialogs * Report a message in a chat for violation of telegram's Terms of Service: messages.report @@ -394,6 +426,7 @@ You can find examples for nearly every MadelineProto function in * Report a peer for violation of telegram's Terms of Service: account.reportPeer * Report a secret chat for spam: messages.reportEncryptedSpam * Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup: channels.reportSpam + * Request a reupload of a certain file to a CDN DC: upload.reuploadCdnFile * Request recovery code of a 2FA password, only for accounts with a recovery email configured: auth.requestPasswordRecovery * Resend the code to verify an email to use as 2FA recovery method: account.resendPasswordEmail * Resend the login code via another medium, the phone code type is determined by the return value of the previous auth.sendCode/auth.resendCode: see login for more info: auth.resendCode @@ -401,20 +434,28 @@ You can find examples for nearly every MadelineProto function in * Reset all active web telegram login sessions: account.resetWebAuthorizations * Reset the 2FA password using the recovery code sent using auth.requestPasswordRecovery: auth.recoverPassword * Resets all notification settings from users and groups: account.resetNotifySettings + * Resolve a @username to get peer info: contacts.resolveUsername * Returns URL with the chat statistics. Currently this method can be used only for channels: messages.getStatsURL * Returns a Telegram Passport authorization form for sharing data with a service: account.getAuthorizationForm + * Returns a current state of updates: updates.getState * Returns a list of available wallpapers: account.getWallPapers * Returns an HTTP URL which can be used to automatically log in into translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation: messages.getEmojiURL * Returns basic user info according to their identifiers: users.getUsers * Returns chat basic info on their IDs: messages.getChats + * Returns configuration parameters for Diffie-Hellman key generation. Can also return a random sequence of bytes of required length: messages.getDhConfig + * Returns content of a whole file or its part: upload.getFile * Returns content of an HTTP file or a part, by proxying the request through telegram: upload.getWebFile - * Returns current configuration, icluding data center configuration: help.getConfig + * Returns current configuration, including data center configuration: help.getConfig + * Returns data for copying authorization to another data-centre: auth.exportAuthorization + * Returns extended user info by ID: users.getFullUser + * Returns full chat info according to its ID: messages.getFullChat * Returns info on data centre nearest to the user: help.getNearestDc * Returns information on update availability for the current application: help.getAppUpdate * Returns list of chats with non-default notification settings: account.getNotifyExceptions - * Returns text of a text message with an invitation: help.getInviteText + * Returns localized text of a text message with an invitation: help.getInviteText * Returns the current user dialog list: messages.getDialogs * Returns the current user's contact list: contacts.getContacts + * Returns the difference between the current state of updates of a certain channel and transmitted: updates.getChannelDifference * Returns the list of blocked users: contacts.getBlocked * Returns the list of contact statuses: contacts.getStatuses * Returns the list of messages by their IDs: messages.getMessages @@ -424,6 +465,8 @@ You can find examples for nearly every MadelineProto function in * Save a message draft associated to a chat: messages.saveDraft * Save a theme: account.saveTheme * Save get all message drafts: messages.getAllDrafts + * Saves a part of a large file (over 10Mb in size) to be later passed to one of the methods: upload.saveBigFilePart + * Saves a part of file for futher sending to one of the methods: upload.saveFilePart * Saves logs of application on the server: help.saveAppLog * Search for GIFs: messages.searchGifs * Search for messages and peers globally: messages.searchGlobal @@ -436,6 +479,7 @@ You can find examples for nearly every MadelineProto function in * Send confirmation code to cancel account deletion, for more info click here »: account.sendConfirmPhoneCode * Send phone call debug data to server: phone.saveCallDebug * Send scheduled messages right away: messages.sendScheduledMessages + * Send the verification code for login: auth.sendCode * Send the verification email code for telegram passport: account.sendVerifyEmailCode * Send the verification phone code for telegram passport: account.sendVerifyPhoneCode * Send typing event by the current user to a secret chat: messages.setEncryptedTyping @@ -444,19 +488,28 @@ You can find examples for nearly every MadelineProto function in * Sends a custom request; for bots only: bots.sendCustomRequest * Sends a message to a chat: messages.sendMessage * Sends a message with a file attachment to a secret chat: messages.sendEncryptedFile + * Sends a request to start a secret chat to the user: messages.requestEncryption * Sends a service message to a secret chat: messages.sendEncryptedService * Sends a text message to a secret chat: messages.sendEncrypted + * Set a new 2FA password: account.updatePasswordSettings * Set account self-destruction period: account.setAccountTTL + * Set bot command list: bots.setBotCommands + * Set sensitive content settings (for viewing or hiding NSFW content): account.setContentSettings + * Set stickerset thumbnail: stickers.setStickerSetThumb * Set the callback answer to a user button press (bots only): messages.setBotCallbackAnswer * Should be called after the user hides the report spam/add as contact bar of a new chat, effectively prevents the user from executing the actions specified in the peer's settings: messages.hidePeerSettingsBar + * Signs in a user with a validated phone number: auth.signIn * Start a conversation with a bot using a deep linking parameter: messages.startBot + * Start a telegram phone call: phone.requestCall * Submit requested order information for validation: payments.validateRequestedInfo * Terminates all user's authorized sessions except for the current one: auth.resetAuthorizations * Toggle contact sign up notifications: account.setContactSignUpNotification * Toggle supergroup slow mode: if enabled, users will only be able to send one message every seconds seconds: channels.toggleSlowMode * Transfer channel ownership: channels.editCreator + * Try logging to an account protected by a 2FA password: auth.checkPassword * Turn a legacy group into a supergroup: messages.migrateChat * Uninstall a stickerset: messages.uninstallStickerSet + * Update folder: messages.updateDialogFilter * Update theme: account.updateTheme * Updates current user profile photo: photos.uploadProfilePhoto * Updates online user status: account.updateStatus @@ -475,40 +528,7 @@ You can find examples for nearly every MadelineProto function in * Vote in a poll: messages.sendVote * When client-side passcode lock feature is enabled, will not show message texts in incoming PUSH notifications: account.updateDeviceLocked * Whether the user will receive notifications when contacts sign up: account.getContactSignUpNotification - * 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->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 - * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates: 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#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: phone.requestCall - * 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 botLogin method instead (see https://docs.madelineproto.xyz for more info): auth.importBotAuthorization - * You cannot use this method directly, use the complete2falogin method instead (see https://docs.madelineproto.xyz for more info): auth.checkPassword - * You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info): auth.signIn - * You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info): auth.signUp - * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info): channels.getFullChannel - * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info): messages.getFullChat - * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info): users.getFullUser - * You cannot use this method directly, use the logout method instead (see https://docs.madelineproto.xyz for more info): auth.logOut - * You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info): auth.sendCode - * You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info): contacts.resolveUsername - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info: 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.getCdnFileHashes - * 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.getFileHashes - * 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.saveBigFilePart - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info: upload.saveFilePart - * You cannot use this method directly: messages.receivedQueue - * You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.getPasswordSettings - * You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info): account.updatePasswordSettings + * Complete phone call E2E encryption key exchange »: phone.confirmCall * [Peers](https://docs.madelineproto.xyz/docs/USING_METHODS.html#peers) * [Files](https://docs.madelineproto.xyz/docs/FILES.html) * [Secret chats](https://docs.madelineproto.xyz/docs/USING_METHODS.html#secret-chats) diff --git a/composer.json b/composer.json index b4bcc079..f83095ca 100644 --- a/composer.json +++ b/composer.json @@ -74,7 +74,12 @@ "autoload-dev": { "psr-4": { "danog\\MadelineProto\\Test\\": "tests/danog/" - } + }, + "files": [ + "tools/build_docs/schemas.php", + "tools/build_docs/merge.php", + "tools/build_docs/layerUpgrade.php" + ] }, "repositories": [{ "type": "git", diff --git a/docs b/docs index f49ae1bc..83cd0b56 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit f49ae1bcb6ade347ed852d7c588c740d595b09aa +Subproject commit 83cd0b565ea0bf2f73747cb6a41f2ce3cc99280e diff --git a/examples/bot.php b/examples/bot.php index 5e9cea43..d63751dd 100755 --- a/examples/bot.php +++ b/examples/bot.php @@ -21,9 +21,7 @@ use danog\MadelineProto\API; use danog\MadelineProto\EventHandler; -use danog\MadelineProto\Exception; use danog\MadelineProto\Logger; -use danog\MadelineProto\RPCErrorException; /* * Various ways to load MadelineProto diff --git a/examples/downloadRenameBot.php b/examples/downloadRenameBot.php index 5c27c240..f62d5110 100755 --- a/examples/downloadRenameBot.php +++ b/examples/downloadRenameBot.php @@ -20,8 +20,8 @@ */ -if (function_exists('memprof_enable')) { - memprof_enable(); +if (\function_exists('memprof_enable')) { + \memprof_enable(); } use Amp\Http\Server\HttpServer; @@ -136,10 +136,10 @@ class MyEventHandler extends \danog\MadelineProto\EventHandler return $this->messages->sendMessage(['peer' => $peerId, 'message' => self::START, 'parse_mode' => 'Markdown', 'reply_to_msg_id' => $messageId]); } if ($update['message']['message'] === '/report' && $peerId === $this->adminId) { - memprof_dump_callgrind($stm = fopen("php://memory", "w")); - fseek($stm, 0); + \memprof_dump_callgrind($stm = \fopen("php://memory", "w")); + \fseek($stm, 0); yield $this->messages->sendMedia(['peer' => $peerId, 'media' => ['_' => 'inputMediaUploadedDocument', 'file' => $stm, 'attributes' => [['_' => 'documentAttributeFilename', 'file_name' => 'callgrind.out']]]]); - fclose($stm); + \fclose($stm); return; } if (isset($update['message']['media']['_']) && $update['message']['media']['_'] !== 'messageMediaWebPage') { diff --git a/schemas b/schemas index 3027150b..ef59cc0c 160000 --- a/schemas +++ b/schemas @@ -1 +1 @@ -Subproject commit 3027150b5e9a5bb88acbfe97e7c5b0b7748c7bcf +Subproject commit ef59cc0cb6723ebd600643faa50205065e8ee578 diff --git a/src/danog/MadelineProto/AbstractAPIFactory.php b/src/danog/MadelineProto/AbstractAPIFactory.php index e9cacd41..44c07315 100644 --- a/src/danog/MadelineProto/AbstractAPIFactory.php +++ b/src/danog/MadelineProto/AbstractAPIFactory.php @@ -223,7 +223,7 @@ abstract class AbstractAPIFactory extends AsyncConstruct if (\strpos($method, '_') !== false) { $finalMethods[\strtolower(\str_replace('_', '', $method))] = $actual_method; } else { - $finalMethods[\strtolower(Tools::toSnakeCase($method))] = $actual_method; + $finalMethods[\strtolower(StrTools::toSnakeCase($method))] = $actual_method; } } diff --git a/src/danog/MadelineProto/AnnotationsBuilder.php b/src/danog/MadelineProto/AnnotationsBuilder.php index bd9cc367..db4a70ba 100644 --- a/src/danog/MadelineProto/AnnotationsBuilder.php +++ b/src/danog/MadelineProto/AnnotationsBuilder.php @@ -105,7 +105,7 @@ class AnnotationsBuilder if (!\in_array($namespace, $this->TL->getMethodNamespaces())) { continue; } - $internalDoc[$namespace][$method]['title'] = \str_replace(['](../', '.md'], ['](https://docs.madelineproto.xyz/API_docs/', '.html'], Lang::$current_lang["method_{$data['method']}"] ?? ''); + $internalDoc[$namespace][$method]['title'] = \str_replace(['](../', '.md'], ['](https://docs.madelineproto.xyz/API_docs/', '.html'], Lang::$lang['en']["method_{$data['method']}"] ?? ''); $type = \str_ireplace(['vector<', '>'], [' of ', '[]'], $data['type']); foreach ($data['params'] as $param) { if (\in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) { @@ -135,7 +135,7 @@ class AnnotationsBuilder } $ptype = $stype === 'type' ? $ptype : "[{$ptype}]"; $opt = $param['pow'] ?? false ? 'Optional: ' : ''; - $internalDoc[$namespace][$method]['attr'][$param['name']] = ['type' => $ptype, 'description' => \str_replace(['](../', '.md'], ['](https://docs.madelineproto.xyz/API_docs/', '.html'], $opt.(Lang::$current_lang["method_{$data['method']}_param_{$param['name']}_type_{$param['type']}"] ?? ''))]; + $internalDoc[$namespace][$method]['attr'][$param['name']] = ['type' => $ptype, 'description' => \str_replace(['](../', '.md'], ['](https://docs.madelineproto.xyz/API_docs/', '.html'], $opt.(Lang::$lang['en']["method_{$data['method']}_param_{$param['name']}_type_{$param['type']}"] ?? ''))]; } if ($type === 'Bool') { $type = \strtolower($type); @@ -193,7 +193,7 @@ class AnnotationsBuilder $name = \str_ireplace('async', '', $name); } } - $name = Tools::toCamelCase($name); + $name = StrTools::toCamelCase($name); $name = \str_ireplace(['mtproto', 'api'], ['MTProto', 'API'], $name); $doc = 'public function '; $doc .= $name; diff --git a/src/danog/MadelineProto/Db/ArrayCacheTrait.php b/src/danog/MadelineProto/Db/ArrayCacheTrait.php index 20abdb9c..96b360f3 100644 --- a/src/danog/MadelineProto/Db/ArrayCacheTrait.php +++ b/src/danog/MadelineProto/Db/ArrayCacheTrait.php @@ -15,7 +15,7 @@ trait ArrayCacheTrait * 'ttl' => int * ], * ... - * ] + * ]. * @var array */ protected array $cache = []; @@ -29,14 +29,14 @@ trait ArrayCacheTrait if (\is_array($cacheItem)) { $result = $cacheItem['value']; - $this->cache[$key]['ttl'] = strtotime($this->ttl); + $this->cache[$key]['ttl'] = \strtotime($this->ttl); } return $result; } /** - * Save item in cache + * Save item in cache. * * @param string $key * @param $value @@ -45,12 +45,12 @@ trait ArrayCacheTrait { $this->cache[$key] = [ 'value' => $value, - 'ttl' => strtotime($this->ttl), + 'ttl' => \strtotime($this->ttl), ]; } /** - * Remove key from cache + * Remove key from cache. * * @param string $key */ @@ -61,15 +61,15 @@ trait ArrayCacheTrait protected function startCacheCleanupLoop(): void { - Loop::repeat(strtotime($this->ttlCheckInterval, 0) * 1000, fn() => $this->cleanupCache()); + Loop::repeat(\strtotime($this->ttlCheckInterval, 0) * 1000, fn () => $this->cleanupCache()); } /** - * Remove all keys from cache + * Remove all keys from cache. */ protected function cleanupCache(): void { - $now = time(); + $now = \time(); $oldKeys = []; foreach ($this->cache as $cacheKey => $cacheValue) { if ($cacheValue['ttl'] < $now) { @@ -81,12 +81,13 @@ trait ArrayCacheTrait } Logger::log( - sprintf( + \sprintf( "cache for table:%s; keys left: %s; keys removed: %s", - $this->table, \count($this->cache), \count($oldKeys) + $this->table, + \count($this->cache), + \count($oldKeys) ), Logger::VERBOSE ); } - -} \ No newline at end of file +} diff --git a/src/danog/MadelineProto/Db/DbArray.php b/src/danog/MadelineProto/Db/DbArray.php index b86385d8..f98a7991 100644 --- a/src/danog/MadelineProto/Db/DbArray.php +++ b/src/danog/MadelineProto/Db/DbArray.php @@ -25,4 +25,4 @@ interface DbArray extends DbType, \ArrayAccess, \Countable * @return bool */ public function offsetExists($offset); -} \ No newline at end of file +} diff --git a/src/danog/MadelineProto/Db/DbPropertiesFabric.php b/src/danog/MadelineProto/Db/DbPropertiesFabric.php index 7e85f5db..5894e637 100644 --- a/src/danog/MadelineProto/Db/DbPropertiesFabric.php +++ b/src/danog/MadelineProto/Db/DbPropertiesFabric.php @@ -23,7 +23,7 @@ class DbPropertiesFabric { $class = __NAMESPACE__; - switch (strtolower($dbSettings['type'])) { + switch (\strtolower($dbSettings['type'])) { case 'memory': $class .= '\Memory'; break; @@ -36,7 +36,7 @@ class DbPropertiesFabric } /** @var DbType $class */ - switch (strtolower($propertyType)){ + switch (\strtolower($propertyType)) { case 'array': $class .= 'Array'; break; @@ -46,5 +46,4 @@ class DbPropertiesFabric return $class::getInstance($name, $value, $namePrefix, $dbSettings[$dbSettings['type']]??[]); } - -} \ No newline at end of file +} diff --git a/src/danog/MadelineProto/Db/DbPropertiesTrait.php b/src/danog/MadelineProto/Db/DbPropertiesTrait.php index 4c5a6f33..8463eba0 100644 --- a/src/danog/MadelineProto/Db/DbPropertiesTrait.php +++ b/src/danog/MadelineProto/Db/DbPropertiesTrait.php @@ -7,7 +7,6 @@ use danog\MadelineProto\MTProto; trait DbPropertiesTrait { - public function initDb(MTProto $MadelineProto, bool $reset = false): \Generator { if (empty($this->dbProperies)) { @@ -42,11 +41,11 @@ trait DbPropertiesTrait $result = $madelineProto->getSelf()['id'] ?? null; if (!$result) { $result = 'tmp_'; - $result .= str_replace('0','', spl_object_hash($madelineProto)); + $result .= \str_replace('0', '', \spl_object_hash($madelineProto)); } - $className = explode('\\',__CLASS__); - $result .= '_' . end($className); + $className = \explode('\\', __CLASS__); + $result .= '_' . \end($className); return $result; } -} \ No newline at end of file +} diff --git a/src/danog/MadelineProto/Db/DbType.php b/src/danog/MadelineProto/Db/DbType.php index 19f15e04..9c8b3050 100644 --- a/src/danog/MadelineProto/Db/DbType.php +++ b/src/danog/MadelineProto/Db/DbType.php @@ -14,5 +14,5 @@ interface DbType * * @return Promise */ - static function getInstance(string $name, $value = null, string $tablePrefix = '', array $settings = []): Promise; -} \ No newline at end of file + public static function getInstance(string $name, $value = null, string $tablePrefix = '', array $settings = []): Promise; +} diff --git a/src/danog/MadelineProto/Db/MemoryArray.php b/src/danog/MadelineProto/Db/MemoryArray.php index 8a97116f..f09efd9d 100644 --- a/src/danog/MadelineProto/Db/MemoryArray.php +++ b/src/danog/MadelineProto/Db/MemoryArray.php @@ -16,7 +16,7 @@ class MemoryArray extends \ArrayIterator implements DbArray public static function getInstance(string $name, $value = null, string $tablePrefix = '', array $settings = []): Promise { - return call(static function() use ($value) { + return call(static function () use ($value) { if ($value instanceof MemoryArray) { return $value; } @@ -35,27 +35,27 @@ class MemoryArray extends \ArrayIterator implements DbArray public function isset($key): Promise { - return call(fn() => parent::offsetExists($key)); + return call(fn () => parent::offsetExists($key)); } public function offsetGet($offset): Promise { - return call(fn() => parent::offsetExists($offset) ? parent::offsetGet($offset) : null); + return call(fn () => parent::offsetExists($offset) ? parent::offsetGet($offset) : null); } public function offsetUnset($offset): Promise { - return call(fn() => parent::offsetUnset($offset)); + return call(fn () => parent::offsetUnset($offset)); } public function count(): Promise { - return call(fn() => parent::count()); + return call(fn () => parent::count()); } public function getArrayCopy(): Promise { - return call(fn() => parent::getArrayCopy()); + return call(fn () => parent::getArrayCopy()); } public function getIterator(): Producer @@ -66,4 +66,4 @@ class MemoryArray extends \ArrayIterator implements DbArray } }); } -} \ No newline at end of file +} diff --git a/src/danog/MadelineProto/Db/Mysql.php b/src/danog/MadelineProto/Db/Mysql.php index 75d5618e..83fc5e49 100644 --- a/src/danog/MadelineProto/Db/Mysql.php +++ b/src/danog/MadelineProto/Db/Mysql.php @@ -38,8 +38,7 @@ class Mysql string $db = 'MadelineProto', int $maxConnections = ConnectionPool::DEFAULT_MAX_CONNECTIONS, int $idleTimeout = ConnectionPool::DEFAULT_IDLE_TIMEOUT - ): Pool - { + ): Pool { $dbKey = "$host:$port:$db"; if (empty(static::$connections[$dbKey])) { $config = ConnectionConfig::fromString( @@ -62,7 +61,7 @@ class Mysql */ private static function createDb(ConnectionConfig $config) { - wait(call(static function() use($config) { + wait(call(static function () use ($config) { try { $db = $config->getDatabase(); $connection = pool($config->withDatabase(null)); @@ -76,7 +75,5 @@ class Mysql Logger::log($e->getMessage(), Logger::ERROR); } })); - } - -} \ No newline at end of file +} diff --git a/src/danog/MadelineProto/Db/MysqlArray.php b/src/danog/MadelineProto/Db/MysqlArray.php index e29e4657..ed72dc0d 100644 --- a/src/danog/MadelineProto/Db/MysqlArray.php +++ b/src/danog/MadelineProto/Db/MysqlArray.php @@ -35,17 +35,16 @@ class MysqlArray implements DbArray } catch (\Throwable $e) { Logger::log($e->getMessage(), Logger::ERROR); } - } - /** - * @param string $name - * @param DbArray|array|null $value - * @param string $tablePrefix - * @param array $settings - * - * @return Promise - */ + /** + * @param string $name + * @param DbArray|array|null $value + * @param string $tablePrefix + * @param array $settings + * + * @return Promise + */ public static function getInstance(string $name, $value = null, string $tablePrefix = '', array $settings = []): Promise { $tableName = "{$tablePrefix}_{$name}"; @@ -62,7 +61,7 @@ class MysqlArray implements DbArray $instance->startCacheCleanupLoop(); - return call(static function() use($instance, $value) { + return call(static function () use ($instance, $value) { yield from $instance->prepareTable(); //Skip migrations if its same object @@ -75,18 +74,18 @@ class MysqlArray implements DbArray }); } - /** - * @param MysqlArray $instance - * @param DbArray|array|null $value - * - * @return \Generator - */ + /** + * @param MysqlArray $instance + * @param DbArray|array|null $value + * + * @return \Generator + */ private static function renameTmpTable(MysqlArray $instance, $value): \Generator { if ($value instanceof static && $value->table) { if ( $value->table !== $instance->table && - mb_strpos($instance->table, 'tmp') !== 0 + \mb_strpos($instance->table, 'tmp') !== 0 ) { yield from $instance->renameTable($value->table, $instance->table); } else { @@ -95,13 +94,13 @@ class MysqlArray implements DbArray } } - /** - * @param MysqlArray $instance - * @param DbArray|array|null $value - * - * @return \Generator - * @throws \Throwable - */ + /** + * @param MysqlArray $instance + * @param DbArray|array|null $value + * + * @return \Generator + * @throws \Throwable + */ private static function migrateDataToDb(MysqlArray $instance, $value): \Generator { if (!empty($value) && !$value instanceof MysqlArray) { @@ -113,7 +112,7 @@ class MysqlArray implements DbArray $value = (array) $value; } $counter = 0; - $total = count($value); + $total = \count($value); foreach ($value as $key => $item) { $counter++; if ($counter % 500 === 0) { @@ -122,7 +121,6 @@ class MysqlArray implements DbArray } else { $instance->offsetSet($key, $item); } - } Logger::log('Converting database done.', Logger::ERROR); } @@ -134,7 +132,7 @@ class MysqlArray implements DbArray } /** - * Check if key isset + * Check if key isset. * * @param $key * @@ -142,13 +140,13 @@ class MysqlArray implements DbArray */ public function isset($key): Promise { - return call(fn() => yield $this->offsetGet($key) !== null); + return call(fn () => yield $this->offsetGet($key) !== null); } public function offsetGet($offset): Promise { - return call(function() use($offset) { + return call(function () use ($offset) { if ($cached = $this->getCache($offset)) { return $cached; } @@ -167,7 +165,7 @@ class MysqlArray implements DbArray } /** - * Set value for an offset + * Set value for an offset. * * @link https://php.net/manual/en/arrayiterator.offsetset.php * @@ -182,30 +180,31 @@ class MysqlArray implements DbArray public function offsetSet($index, $value): Promise { if ($this->getCache($index) === $value) { - return call(fn()=>null); + return call(fn () =>null); } $this->setCache($index, $value); - $request = $this->request(" + $request = $this->request( + " INSERT INTO `{$this->table}` SET `key` = :index, `value` = :value ON DUPLICATE KEY UPDATE `value` = :value ", [ 'index' => $index, - 'value' => serialize($value), + 'value' => \serialize($value), ] ); //Ensure that cache is synced with latest insert in case of concurrent requests. - $request->onResolve(fn() => $this->setCache($index, $value)); + $request->onResolve(fn () => $this->setCache($index, $value)); return $request; } /** - * Unset value for an offset + * Unset value for an offset. * * @link https://php.net/manual/en/arrayiterator.offsetunset.php * @@ -220,7 +219,8 @@ class MysqlArray implements DbArray { $this->unsetCache($index); - return $this->request(" + return $this->request( + " DELETE FROM `{$this->table}` WHERE `key` = :index ", @@ -229,14 +229,14 @@ class MysqlArray implements DbArray } /** - * Get array copy + * Get array copy. * * @return Promise * @throws \Throwable */ public function getArrayCopy(): Promise { - return call(function(){ + return call(function () { $iterator = $this->getIterator(); $result = []; while (yield $iterator->advance()) { @@ -260,7 +260,7 @@ class MysqlArray implements DbArray } /** - * Count elements + * Count elements. * * @link https://php.net/manual/en/arrayiterator.count.php * @return Promise The number of elements or public properties in the associated @@ -269,7 +269,7 @@ class MysqlArray implements DbArray */ public function count(): Promise { - return call(function(){ + return call(function () { $row = yield $this->request("SELECT count(`key`) as `count` FROM `{$this->table}`"); return $row[0]['count'] ?? 0; }); @@ -279,9 +279,9 @@ class MysqlArray implements DbArray { if ($row) { if (!empty($row[0]['value'])) { - $row = reset($row); + $row = \reset($row); } - return unserialize($row['value']); + return \unserialize($row['value']); } return null; } @@ -300,7 +300,7 @@ class MysqlArray implements DbArray } /** - * Create table for property + * Create table for property. * * @return array|null * @throws \Throwable @@ -335,7 +335,7 @@ class MysqlArray implements DbArray } /** - * Perform async request to db + * Perform async request to db. * * @param string $query * @param array $params @@ -345,8 +345,7 @@ class MysqlArray implements DbArray */ private function request(string $query, array $params = []): Promise { - return call(function() use($query, $params) { - + return call(function () use ($query, $params) { Logger::log([$query, $params], Logger::VERBOSE); if (empty($this->db) || !$this->db->isAlive()) { @@ -370,4 +369,4 @@ class MysqlArray implements DbArray return $result; }); } -} \ No newline at end of file +} diff --git a/src/danog/MadelineProto/DocsBuilder.php b/src/danog/MadelineProto/DocsBuilder.php index bb79126b..1f68a5e8 100644 --- a/src/danog/MadelineProto/DocsBuilder.php +++ b/src/danog/MadelineProto/DocsBuilder.php @@ -24,6 +24,17 @@ use danog\MadelineProto\TL\TL; // This code was written a few years ago: it is garbage, and has to be rewritten class DocsBuilder { + const DEFAULT_TEMPLATES = [ + 'User' => ['User', 'InputUser', 'Chat', 'InputChannel', 'Peer', 'InputDialogPeer', 'DialogPeer', 'InputPeer', 'NotifyPeer', 'InputNotifyPeer'], + 'InputFile' => ['InputFile', 'InputEncryptedFile'], + 'InputEncryptedChat' => ['InputEncryptedChat'], + 'PhoneCall' => ['PhoneCall'], + 'InputPhoto' => ['InputPhoto'], + 'InputDocument' => ['InputDocument'], + 'InputMedia' => ['InputMedia'], + 'InputMessage' => ['InputMessage'], + 'KeyboardButton' => ['KeyboardButton'], + ]; use \danog\MadelineProto\DocsBuilder\Methods; use \danog\MadelineProto\DocsBuilder\Constructors; public $td = false; @@ -47,28 +58,26 @@ class DocsBuilder } \chdir($this->settings['output_dir']); $this->index = $settings['readme'] ? 'README.md' : 'index.md'; + + foreach (\glob($this->settings['template']."/*") as $template) { + $this->templates[\basename($template, '.md')] = \file_get_contents($template); + } } + /** + * Documentation templates. + * + * @var array + */ + protected $templates = []; + public $types = []; public $any = '*'; public function mkDocs() { \danog\MadelineProto\Logger::log('Generating documentation index...', \danog\MadelineProto\Logger::NOTICE); - \file_put_contents($this->index, '--- -title: '.$this->settings['title'].' -description: '.$this->settings['description'].' -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# '.$this->settings['description'].' + \file_put_contents($this->index, $this->template('index', $this->settings['title'], $this->settings['description'])); -[Back to main documentation](..) - - -[Methods](methods/) - -[Constructors](constructors/) - -[Types](types/)'); - $this->mkmethodS(); + $this->mkMethods(); $this->mkConstructors(); foreach (\glob('types/*') as $unlink) { \unlink($unlink); @@ -80,548 +89,75 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png \ksort($this->types); $index = ''; \danog\MadelineProto\Logger::log('Generating types documentation...', \danog\MadelineProto\Logger::NOTICE); - $last_namespace = ''; foreach ($this->types as $otype => $keys) { - $new_namespace = \preg_replace('/_.*/', '', $otype); - //$br = $new_namespace != $last_namespace ? '***

' : ''; - $type = \str_replace(['<', '>'], ['_of_', ''], $otype); - $type = \preg_replace('/.*_of_/', '', $type); - $index .= '['.\str_replace('_', '\\_', $type).']('.$type.'.md) + $type = StrTools::typeEscape($otype); + $index .= '['.StrTools::markdownEscape($type).']('.$type.'.md) '; $constructors = ''; foreach ($keys['constructors'] as $data) { $predicate = $data['predicate'].(isset($data['layer']) && $data['layer'] !== '' ? '_'.$data['layer'] : ''); - $md_predicate = \str_replace('_', '\\_', $predicate); - $constructors .= '['.$md_predicate.'](../constructors/'.$predicate.'.md) - -'; + $md_predicate = StrTools::markdownEscape($predicate); + $constructors .= "[$md_predicate](../constructors/$predicate.md) \n\n"; } $methods = ''; foreach ($keys['methods'] as $data) { $name = $data['method']; $md_name = \str_replace(['.', '_'], ['->', '\\_'], $name); - $methods .= '[$MadelineProto->'.$md_name.'](../methods/'.$name.'.md) - -'; + $methods .= "[\$MadelineProto->$md_name](../methods/$name.md) \n\n"; } - $description = isset($this->td_descriptions['types'][$otype]) ? $this->td_descriptions['types'][$otype] : 'constructors and methods of type '.$type; $symFile = \str_replace('.', '_', $type); $redir = $symFile !== $type ? "\nredirect_from: /API_docs/types/{$symFile}.html" : ''; - $header = '--- -title: '.$type.' -description: constructors and methods of type '.$type.' -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png'.$redir.' ---- -# Type: '.\str_replace('_', '\\_', $type).' -[Back to types index](index.md) - - - -'; - $header .= isset($this->td_descriptions['types'][$otype]) ? $this->td_descriptions['types'][$otype].PHP_EOL.PHP_EOL : ''; + $header = ''; if (!isset($this->settings['td'])) { - if (\in_array($type, ['User', 'InputUser', 'Chat', 'InputChannel', 'Peer', 'InputDialogPeer', 'DialogPeer', 'InputPeer', 'NotifyPeer', 'InputNotifyPeer'])) { - $header .= 'You can directly provide the [Update](Update.md) or [Message](Message.md) object here, MadelineProto will automatically extract the destination chat id. - -The following syntaxes can also be used: - -``` -$'.$type." = '@username'; // Username\n\n\$".$type." = 'me'; // The currently logged-in user\n\n\$".$type.' = 44700; // bot API id (users) -$'.$type.' = -492772765; // bot API id (chats) -$'.$type.' = -10038575794; // bot API id (channels) - -$'.$type." = 'https://t.me/danogentili'; // t.me URLs\n\$".$type." = 'https://t.me/joinchat/asfln1-21fa_'; // t.me invite links\n\n\$".$type." = 'user#44700'; // tg-cli style id (users)\n\$".$type." = 'chat#492772765'; // tg-cli style id (chats)\n\$".$type." = 'channel#38575794'; // tg-cli style id (channels)\n```\n\nA [Chat](Chat.md), a [User](User.md), an [InputPeer](InputPeer.md), an [InputDialogPeer](InputDialogPeer.md), an [InputNotifyPeer](InputNotifyPeer.md), an [InputUser](InputUser.md), an [InputChannel](InputChannel.md), a [Peer](Peer.md), an [DialogPeer](DialogPeer.md), [NotifyPeer](NotifyPeer.md), or a [Chat](Chat.md) object can also be used.\n\n\n"; - } - if (\in_array($type, ['InputEncryptedChat'])) { - $header .= 'You can directly provide the [Update](Update.md) or [EncryptedMessage](EncryptedMessage.md) object here, MadelineProto will automatically extract the destination chat id. - -The following syntax can also be used: - -``` -$'.$type.' = -147286699; // Numeric chat id returned by requestSecretChat, can be positive or negative -``` - - -'; - } - if (\in_array($type, ['InputFile', 'InputEncryptedFile'])) { - $header .= 'The following syntax can also be used: - -``` -$'.$type.' = \'filename.mp4\'; // The file path can also be used -``` - - -'; - } - if (\in_array($type, ['InputPhoto'])) { - $header .= 'You can also provide a [MessageMedia](MessageMedia.md), [Message](Message.md), [Update](Update.md), [Photo](Photo.md) here, MadelineProto will automatically convert it to the right type. - -'; - } - if (\in_array($type, ['InputDocument'])) { - $header .= 'You can also provide a [MessageMedia](MessageMedia.md), [Message](Message.md), [Update](Update.md), [Document](Document.md) here, MadelineProto will automatically convert it to the right type. - -'; - } - if (\in_array($type, ['InputMedia'])) { - $header .= 'You can also provide a [MessageMedia](MessageMedia.md), [Message](Message.md), [Update](Update.md), [Document](Document.md), [Photo](Photo.md), [InputDocument](InputDocument.md), [InputPhoto](InputPhoto.md) here, MadelineProto will automatically convert it to the right type. - -'; - } - if (\in_array($type, ['InputMessage'])) { - $header .= 'The following syntax can also be used: - -``` -$'.$type.' = 142; // Numeric message ID -``` - - -'; - } - if (\in_array($type, ['KeyboardButton'])) { - $header .= 'Clicking these buttons: - -To click these buttons simply run the `click` method: - -``` -$result = $'.$type.'->click(); -``` - -`$result` can be one of the following: - - -* A string - If the button is a keyboardButtonUrl - -* [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 - -* `false` - If the button is an unsupported button, like keyboardButtonRequestPhone, keyboardButtonRequestGeoLocation, keyboardButtonSwitchInlinekeyboardButtonBuy; you will have to parse data from these buttons manually - - -You can also access the properties of the constructor as a normal array, for example $button[\'name\'] -'; + foreach (self::DEFAULT_TEMPLATES as $template => $types) { + if (\in_array($type, $types)) { + $header .= $this->template($template, $type); + } } } - $constructors = '### Possible values (constructors): - -'.$constructors.' - -'; - $methods = '### Methods that return an object of this type (methods): - -'.$methods.' - -'; - if (!isset($this->settings['td'])) { - if (\in_array($type, ['PhoneCall'])) { - $methods = ''; - $constructors = ''; - $header .= 'This is an object of type `\\danog\\MadelineProto\\VoIP`. - -It will only be available if the [php-libtgvoip](https://github.com/danog/php-libtgvoip) extension is installed, see [the main docs](https://docs.madelineproto.xyz#calls) for an easy installation script. - -You MUST know [OOP](http://php.net/manual/en/language.oop5.php) to use this class. - -## Constants: - -VoIPController states (these constants are incrementing integers, thus can be compared like numbers): - -* `STATE_CREATED` - controller created -* `STATE_WAIT_INIT` - controller inited -* `STATE_WAIT_INIT_ACK` - controller inited -* `STATE_ESTABLISHED` - connection established -* `STATE_FAILED` - connection failed -* `STATE_RECONNECTING` - reconnecting - -VoIPController errors: - -* `TGVOIP_ERROR_UNKNOWN` - An unknown error occurred -* `TGVOIP_ERROR_INCOMPATIBLE` - The other side is using an unsupported client/protocol -* `TGVOIP_ERROR_TIMEOUT` - A timeout occurred -* `TGVOIP_ERROR_AUDIO_IO` - An I/O error occurred - -Network types (these constants are incrementing integers, thus can be compared like numbers): - -* `NET_TYPE_UNKNOWN` - Unknown network type -* `NET_TYPE_GPRS` - GPRS connection -* `NET_TYPE_EDGE` - EDGE connection -* `NET_TYPE_3G` - 3G connection -* `NET_TYPE_HSPA` - HSPA connection -* `NET_TYPE_LTE` - LTE connection -* `NET_TYPE_WIFI` - WIFI connection -* `NET_TYPE_ETHERNET` - Ethernet connection (this guarantees high audio quality) -* `NET_TYPE_OTHER_HIGH_SPEED` - Other high speed connection -* `NET_TYPE_OTHER_LOW_SPEED` - Other low speed connection -* `NET_TYPE_DIALUP` - Dialup connection -* `NET_TYPE_OTHER_MOBILE` - Other mobile network connection - -Data saving modes (these constants are incrementing integers, thus can be compared like numbers): - -* `DATA_SAVING_NEVER` - Never save data (this guarantees high audio quality) -* `DATA_SAVING_MOBILE` - Use mobile data saving profiles -* `DATA_SAVING_ALWAYS` - Always use data saving profiles - -Proxy settings (these constants are incrementing integers, thus can be compared like numbers): - -* `PROXY_NONE` - No proxy -* `PROXY_SOCKS5` - Use the socks5 protocol - -Audio states (these constants are incrementing integers, thus can be compared like numbers): - -* `AUDIO_STATE_NONE` - The audio module was not created yet -* `AUDIO_STATE_CREATED` - The audio module was created -* `AUDIO_STATE_CONFIGURED` - The audio module was configured -* `AUDIO_STATE_RUNNING` - The audio module is running - -Call states (these constants are incrementing integers, thus can be compared like numbers): - -* `CALL_STATE_NONE` - The call was not created yet -* `CALL_STATE_REQUESTED` - This is an outgoing call -* `CALL_STATE_INCOMING` - This is an incoming call -* `CALL_STATE_ACCEPTED` - The incoming call was accepted, but not yet ready -* `CALL_STATE_CONFIRMED` - The outgoing call was accepted, but not yet ready -* `CALL_STATE_READY` - The call is ready. Audio data is being sent and received -* `CALL_STATE_ENDED` - The call is over. - - - -## Methods: - -* `getState()` - Gets the controller state, as a VoIPController state constant -* `getCallState()` - Gets the call state, as a call state constant -* `getVisualization()` - Gets the visualization of the encryption key, as an array of emojis, can be called only when the call state is bigger than or equal to `CALL_STATE_READY`. If called sooner, returns false. -* `getStats()` Gets connection stats -* `getOtherID()` - Gets the id of the other call participant, as a bot API ID -* `getProtocol()` - Gets the protocol used by the current call, as a [PhoneCallProtocol](https://docs.madelineproto.xyz/API_docs/types/PhoneCallProtocol.html) object -* `getCallID()` - Gets the call ID, as an [InputPhoneCall](https://docs.madelineproto.xyz/API_docs/types/InputPhoneCall.html) object -* `isCreator()` - Returns a boolean that indicates whether you are the creator of the call -* `whenCreated()` - Returns the unix timestamp of when the call was started (when was the call state set to `CALL_STATE_READY`) -* `getOutputState()` - Returns the state of the audio output module, as an audio state constant -* `getInputState()` - Returns the state of the audio input module, as an audio state constant -* `getDebugLog()` - Gets VoIPController debug log -* `getDebugString()` - Gets VoIPController debug string -* `getLastError()` - Gets the last error as a VoIPController error constant -* `getVersion()` - Gets VoIPController version -* `getSignalBarsCount()` - Gets number of signal bars (0-4) - -* `parseConfig()` - Parses the configuration - -* `accept()` - Accepts the phone call, returns `$this` -* `discard($reason = ["_" => "phoneCallDiscardReasonDisconnect"], $rating = [])` - Ends the phone call. - -Accepts two optional parameters: - -`$reason` - can be a [PhoneCallDiscardReason](https://docs.madelineproto.xyz/API_docs/types/PhoneCallDiscardReason.html) object (defaults to a [phoneCallDiscardReasonDisconnect](https://docs.madelineproto.xyz/API_docs/constructors/phoneCallDiscardReasonDisconnect.html) object). - -`$rating` - Can be an array that must contain a rating, and a comment (`["rating" => 5, "comment" => "MadelineProto is very easy to use!"]). Defaults to an empty array.` - - - -* `getOutputParams()` - Returns the output audio configuration - -MadelineProto works using raw signed PCM audio, internally split in packets with `sampleNumber` samples. - -The audio configuration is an array structured in the following way: -``` -[ - "bitsPerSample" => int. // Bits in each PCM sample - "sampleRate" => int, // PCM sample rate - "channels" => int, // Number of PCM audio channels - "sampleNumber" => int, // The audio data is internally split in packets, each having this number of samples - "samplePeriod" => double, // PCM sample period in seconds, useful if you want to generate audio data manually - "writePeriod" => double, // PCM write period in seconds (samplePeriod*sampleNumber), useful if you want to generate audio data manually - "samplesSize" => int, // The audio data is internally split in packets, each having this number of bytes (sampleNumber*bitsPerSample/8) - "level" => int // idk -]; -``` - -* `getInputParams()` - Returns the input audio configuration - -MadelineProto works using raw signed PCM audio, internally split in packets with `sampleNumber` samples. - -The audio configuration is an array structured in the following way: -``` -[ - "bitsPerSample" => int. // Bits in each PCM sample - "sampleRate" => int, // PCM sample rate - "channels" => int, // Number of PCM audio channels - "sampleNumber" => int, // The audio data is internally split in packets, each having this number of samples - "samplePeriod" => double, // PCM sample period in seconds, useful if you want to generate audio data manually - "writePeriod" => double, // PCM write period in seconds (samplePeriod*sampleNumber), useful if you want to generate audio data manually - "samplesSize" => int, // The audio data is internally split in packets, each having this number of bytes (sampleNumber*bitsPerSample/8) -]; -``` - -* `play(string $file)` and `then(string $file)` - Play a certain audio file encoded in PCM, with the audio input configuration, returns `$this` -* `playOnHold(array $files)` - Array of audio files encoded in PCM, with the audio input configuration to loop on hold (when the files given with play/then have finished playing). If not called, no data will be played, returns `$this` -* `isPlaying()` - Returns true if MadelineProto is still playing the files given with play/then, false if the hold files (or nothing) is being played -* `setMicMute(bool $mute)` - Stops/resumes playing files/hold files, returns `$this` - -* `setOutputFile(string $outputfile)` - Writes incoming audio data to file encoded in PCM, with the audio output configuration, returns `$this` -* `unsetOutputFile()` - Stops writing audio data to previously set file, returns `$this` - - -## Properties: - -* `storage`: An array that can be used to store data related to this call. - -Easy as pie: - -``` -$call->storage["pony"] = "fluttershy"; -\\danog\\MadelineProto\\Logger::log($call->storage["pony"]); // fluttershy -``` - -Note: when modifying this property, *never* overwrite the previous values. Always either modify the values of the array separately like showed above, or use array_merge. - - -* `configuration`: An array containing the libtgvoip configuration. - -You can only modify the data saving mode, the network type, the logging file path and the stats dump file path: - -Example: - -``` -$call->configuration["log_file_path"] = "logs".$call->getOtherID().".log"; // Default is /dev/null -$call->configuration["stats_dump_file_path"] = "stats".$call->getOtherID().".log"; // Default is /dev/null -$call->configuration["network_type"] = \\danog\\MadelineProto\\VoIP::NET_TYPE_WIFI; // Default is NET_TYPE_ETHERNET -$call->configuration["data_saving"] = \\danog\\MadelineProto\\VoIP::DATA_SAVING_MOBILE; // Default is DATA_SAVING_NEVER -$call->parseConfig(); // Always call this after changing settings -``` - -Note: when modifying this property, *never* overwrite the previous values. Always either modify the values of the array separately like showed above, or use array_merge. - -After modifying it, you must always parse the new configuration with a call to `parseConfig`. - -'; - } - } - if (\file_exists('types/'.$type.'.md')) { - \danog\MadelineProto\Logger::log($type); + if (isset($this->td_descriptions['types'][$otype])) { + $header = "{$this->td_descriptions['types'][$otype]}\n\n$header"; } + $header = \sprintf( + $this->templates['Type'], + $type, + $redir, + StrTools::markdownEscape($type), + $header, + $constructors, + $methods + ); \file_put_contents('types/'.$type.'.md', $header.$constructors.$methods); - $last_namespace = $new_namespace; } \danog\MadelineProto\Logger::log('Generating types index...', \danog\MadelineProto\Logger::NOTICE); - \file_put_contents('types/'.$this->index, '--- -title: Types -description: List of types -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# Types -[Back to API documentation index](..) + \file_put_contents('types/'.$this->index, $this->templates['types-index'].$index); - -'.$index); \danog\MadelineProto\Logger::log('Generating additional types...', \danog\MadelineProto\Logger::NOTICE); - \file_put_contents('types/string.md', '--- -title: string -description: A UTF8 string of variable length -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: string -[Back to constructor index](index.md) - -A UTF8 string of variable length. The total length in bytes of the string must not be bigger than 16777215. -'); - \file_put_contents('types/bytes.md', '--- -title: bytes -description: A string of variable length -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: bytes -[Back to constructor index](index.md) - -```php -$bytes = "simple string of bytes"; -``` - -Internally, an object of type `\\danog\\MadelineProto\\TL\\Types\\Bytes`. -When casted to string, turns into a string of bytes of variable length, with length smaller than or equal to 16777215. -When JSON-serialized, turns into an array of the following format: -``` -[ - \'_\' => \'bytes\', - \'bytes\' => base64_encode($contents) -]; -``` -'); - \file_put_contents('types/int.md', '--- -title: integer -description: A 32 bit signed integer ranging from -2147483648 to 2147483647 -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: int -[Back to constructor index](index.md) - -A 32 bit signed integer ranging from `-2147483648` to `2147483647`. -'); - \file_put_contents('types/int53.md', '--- -title: integer -description: A 53 bit signed integer -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: int53 -[Back to constructor index](index.md) - -A 53 bit signed integer. -'); - \file_put_contents('types/long.md', '--- -title: long -description: A 32 bit signed integer ranging from -9223372036854775808 to 9223372036854775807 -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: long -[Back to constructor index](index.md) - -A 64 bit signed integer ranging from `-9223372036854775808` to `9223372036854775807`. -'); - \file_put_contents('types/int128.md', '--- -title: int128 -description: A 128 bit signed integer -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: int128 -[Back to constructor index](index.md) - -A 128 bit signed integer represented in little-endian base256 (`string`) format. -'); - \file_put_contents('types/int256.md', '--- -title: int256 -description: A 256 bit signed integer -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: int256 -[Back to constructor index](index.md) - -A 256 bit signed integer represented in little-endian base256 (`string`) format. -'); - \file_put_contents('types/int512.md', '--- -title: int512 -description: A 512 bit signed integer -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: int512 -[Back to constructor index](index.md) - -A 512 bit signed integer represented in little-endian base256 (`string`) format. -'); - \file_put_contents('types/double.md', '--- -title: double -description: A double precision floating point number -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: double -[Back to constructor index](index.md) - -A double precision floating point number, single precision can also be used (float). -'); - \file_put_contents('types/!X.md', '--- -title: !X -description: Represents a TL serialized payload -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: !X -[Back to constructor index](index.md) - -Represents a TL serialized payload. -'); - \file_put_contents('types/X.md', '--- -title: X -description: Represents a TL serialized payload -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: X -[Back to constructor index](index.md) - -Represents a TL serialized payload. -'); - \file_put_contents('constructors/boolFalse.md', '--- -title: boolFalse -description: Represents a boolean with value equal to false -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# boolFalse -[Back to constructor index](index.md) - - Represents a boolean with value equal to `false`. -'); - \file_put_contents('constructors/boolTrue.md', '--- -title: boolTrue -description: Represents a boolean with value equal to true -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# boolTrue -[Back to constructor index](index.md) - -Represents a boolean with value equal to `true`. -'); - \file_put_contents('constructors/null.md', '--- -title: null -description: Represents a null value -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# null -[Back to constructor index](index.md) - -Represents a `null` value. -'); - \file_put_contents('types/Bool.md', '--- -title: Bool -description: Represents a boolean. -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# Bool -[Back to types index](index.md) - -Represents a boolean. -'); - \file_put_contents('types/DataJSON.md', '--- -title: DataJSON -description: Any json-encodable data -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -## Type: DataJSON -[Back to constructor index](index.md) - -Any json-encodable data. -'); + foreach (['string', 'bytes', 'int', 'int53', 'long', 'int128', 'int256', 'int512', 'double', 'Bool', 'DataJSON'] as $type) { + \file_put_contents("types/$type.md", $this->templates[$type]); + } + foreach (['boolFalse', 'boolTrue', 'null'] as $constructor) { + \file_put_contents("constructors/$constructor.md", $this->templates[$constructor]); + } \danog\MadelineProto\Logger::log('Done!', \danog\MadelineProto\Logger::NOTICE); } - public static $template = '. - * - * @author Daniil Gentili - * @copyright 2016-2020 Daniil Gentili - * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 - * @link https://docs.madelineproto.xyz MadelineProto documentation - */ - -namespace danog\\MadelineProto; - -class Lang -{ - public static $lang = %s; - - // THIS WILL BE OVERWRITTEN BY $lang["en"] - public static $current_lang = %s; -}'; public static function addToLang(string $key, string $value = '', bool $force = false) { if (!isset(\danog\MadelineProto\Lang::$lang['en'][$key]) || $force) { \danog\MadelineProto\Lang::$lang['en'][$key] = $value; - //\file_put_contents(__DIR__.'/Lang.php', \sprintf(self::$template, \var_export(\danog\MadelineProto\Lang::$lang, true), \var_export(\danog\MadelineProto\Lang::$lang['en'], true))); } } + /** + * Get formatted template string. + * + * @param string $name Template name + * @param string[] ...$params Params + * + * @return string + */ + protected function template(string $name, ...$params): string + { + return \sprintf($this->templates[$name], ...$params); + } } diff --git a/src/danog/MadelineProto/DocsBuilder/Constructors.php b/src/danog/MadelineProto/DocsBuilder/Constructors.php index 7d8555ab..0312cf54 100644 --- a/src/danog/MadelineProto/DocsBuilder/Constructors.php +++ b/src/danog/MadelineProto/DocsBuilder/Constructors.php @@ -19,6 +19,7 @@ namespace danog\MadelineProto\DocsBuilder; +use danog\MadelineProto\StrTools; use danog\MadelineProto\Tools; trait Constructors @@ -41,15 +42,11 @@ trait Constructors $data['layer'] = ''; } $got[$id] = ''; - /* - if (preg_match('/%/', $type)) { - $type = $this->TL->getConstructors($this->td)->findByType(str_replace('%', '', $type))['predicate']; - }*/ $layer = isset($data['layer']) && $data['layer'] !== '' ? '_'.$data['layer'] : ''; - $type = \str_replace(['<', '>'], ['_of_', ''], $data['type']); - $php_type = \preg_replace('/.*_of_/', '', $type); - $constructor = \str_replace(['<', '>'], ['_of_', ''], $data['predicate']); - $php_constructor = \preg_replace('/.*_of_/', '', $constructor); + $type = $data['type']; + $constructor = $data['predicate']; + $php_type = Tools::typeEscape($type); + $php_constructor = Tools::typeEscape($constructor); if (!isset($this->types[$php_type])) { $this->types[$php_type] = ['constructors' => [], 'methods' => []]; } @@ -78,7 +75,7 @@ trait Constructors $param[$type_or_subtype] = '['.Tools::markdownEscape($param[$type_or_subtype]).'](../'.$type_or_bare_type.'/'.$param[$type_or_subtype].'.md)'; $params .= (isset($param['subtype']) ? '\\['.$param[$type_or_subtype].'\\]' : $param[$type_or_subtype]).', '; } - $md_constructor = \str_replace('_', '\\_', $constructor.$layer); + $md_constructor = StrTools::markdownEscape($constructor.$layer); $this->docs_constructors[$constructor] = '[$'.$md_constructor.'](../constructors/'.$php_constructor.$layer.'.md) = \\['.$params.'\\]; '; @@ -87,13 +84,13 @@ trait Constructors | Name | Type | Required | |----------|---------------|----------| '; - if (!isset($this->TL->getDescriptions()['constructors'][$data['predicate']])) { - $this->addToLang('object_'.$data['predicate']); - if (\danog\MadelineProto\Lang::$lang['en']['object_'.$data['predicate']] !== '') { - $this->TL->getDescriptions()['constructors'][$data['predicate']]['description'] = \danog\MadelineProto\Lang::$lang['en']['object_'.$data['predicate']]; + if (!isset($this->TL->getDescriptions()['constructors'][$constructor])) { + $this->addToLang('object_'.$constructor); + if (\danog\MadelineProto\Lang::$lang['en']['object_'.$constructor] !== '') { + $this->TL->getDescriptions()['constructors'][$constructor]['description'] = \danog\MadelineProto\Lang::$lang['en']['object_'.$constructor]; } } - if (isset($this->TL->getDescriptions()['constructors'][$data['predicate']]) && !empty($data['params'])) { + if (isset($this->TL->getDescriptions()['constructors'][$constructor]) && !empty($data['params'])) { $table = '### Attributes: | Name | Type | Required | Description | @@ -114,16 +111,10 @@ trait Constructors $param['type'] = 'DecryptedMessage'; } if ($type === 'DecryptedMessageMedia' && \in_array($param['name'], ['key', 'iv'])) { - unset(\danog\MadelineProto\Lang::$lang['en']['object_'.$data['predicate'].'_param_'.$param['name'].'_type_'.$param['type']]); + unset(\danog\MadelineProto\Lang::$lang['en']['object_'.$constructor.'_param_'.$param['name'].'_type_'.$param['type']]); continue; } $ptype = $param[isset($param['subtype']) ? 'subtype' : 'type']; - //$type_or_bare_type = 'types'; - /*if (isset($param['subtype'])) { - if ($param['type'] === 'vector') { - $type_or_bare_type = 'constructors'; - } - }*/ if (\preg_match('/%/', $ptype)) { $ptype = $this->TL->getConstructors($this->td)->findByType(\str_replace('%', '', $ptype))['predicate']; } @@ -155,15 +146,15 @@ trait Constructors if (\in_array($ptype, ['InputEncryptedFile']) && !isset($this->settings['td'])) { $human_ptype = 'File path or '.$ptype; } - $table .= '|'.\str_replace('_', '\\_', $param['name']).'|'.(isset($param['subtype']) ? 'Array of ' : '').'['.\str_replace('_', '\\_', $human_ptype).'](../'.$type_or_bare_type.'/'.$ptype.'.md) | '.(isset($param['pow']) || $this->TL->getConstructors($this->td)->findByPredicate(\lcfirst($param['type']).'Empty') || $data['type'] === 'InputMedia' && $param['name'] === 'mime_type' || $data['type'] === 'DocumentAttribute' && \in_array($param['name'], ['w', 'h', 'duration']) ? 'Optional' : 'Yes').'|'; - if (!isset($this->TL->getDescriptions()['constructors'][$data['predicate']]['params'][$param['name']])) { - $this->addToLang('object_'.$data['predicate'].'_param_'.$param['name'].'_type_'.$param['type']); - if (isset($this->TL->getDescriptions()['constructors'][$data['predicate']]['description'])) { - $this->TL->getDescriptions()['constructors'][$data['predicate']]['params'][$param['name']] = \danog\MadelineProto\Lang::$lang['en']['object_'.$data['predicate'].'_param_'.$param['name'].'_type_'.$param['type']]; + $table .= '|'.StrTools::markdownEscape($param['name']).'|'.(isset($param['subtype']) ? 'Array of ' : '').'['.StrTools::markdownEscape($human_ptype).'](../'.$type_or_bare_type.'/'.$ptype.'.md) | '.(isset($param['pow']) || $this->TL->getConstructors($this->td)->findByPredicate(\lcfirst($param['type']).'Empty') || $data['type'] === 'InputMedia' && $param['name'] === 'mime_type' || $data['type'] === 'DocumentAttribute' && \in_array($param['name'], ['w', 'h', 'duration']) ? 'Optional' : 'Yes').'|'; + if (!isset($this->TL->getDescriptions()['constructors'][$constructor]['params'][$param['name']])) { + $this->addToLang('object_'.$constructor.'_param_'.$param['name'].'_type_'.$param['type']); + if (isset($this->TL->getDescriptions()['constructors'][$constructor]['description'])) { + $this->TL->getDescriptions()['constructors'][$constructor]['params'][$param['name']] = \danog\MadelineProto\Lang::$lang['en']['object_'.$constructor.'_param_'.$param['name'].'_type_'.$param['type']]; } } - if (isset($this->TL->getDescriptions()['constructors'][$data['predicate']]['params'][$param['name']])) { - $table .= $this->TL->getDescriptions()['constructors'][$data['predicate']]['params'][$param['name']].'|'; + if (isset($this->TL->getDescriptions()['constructors'][$constructor]['params'][$param['name']]) && $this->TL->getDescriptions()['constructors'][$constructor]['params'][$param['name']]) { + $table .= $this->TL->getDescriptions()['constructors'][$constructor]['params'][$param['name']].'|'; } $table .= PHP_EOL; $pptype = \in_array($ptype, ['string', 'bytes']) ? "'".$ptype."'" : $ptype; @@ -178,18 +169,18 @@ trait Constructors $hasreplymarkup = true; } } - $params = "['_' => '".$data['predicate']."'".$params.']'; - $lua_params = "{_='".$data['predicate']."'".$lua_params.'}'; - $pwr_params = '{"_": "'.$data['predicate'].'"'.$pwr_params.'}'; - $description = isset($this->TL->getDescriptions()['constructors'][$data['predicate']]) ? $this->TL->getDescriptions()['constructors'][$data['predicate']]['description'] : $constructor.' attributes, type and example'; + $params = "['_' => '".$constructor."'".$params.']'; + $lua_params = "{_='".$constructor."'".$lua_params.'}'; + $pwr_params = '{"_": "'.$constructor.'"'.$pwr_params.'}'; + $description = isset($this->TL->getDescriptions()['constructors'][$constructor]) ? $this->TL->getDescriptions()['constructors'][$constructor]['description'] : $constructor.' attributes, type and example'; $symFile = \str_replace('.', '_', $constructor.$layer); $redir = $symFile !== $constructor.$layer ? "\nredirect_from: /API_docs/constructors/{$symFile}.html" : ''; $header = '--- -title: '.$data['predicate'].' +title: '.$constructor.' description: '.$description.' image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png'.$redir.' --- -# Constructor: '.\str_replace('_', '\\_', $data['predicate'].$layer).' +# Constructor: '.StrTools::markdownEscape($constructor.$layer).' [Back to constructors index](index.md) @@ -199,73 +190,21 @@ image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png'.$redi '; - if (isset($this->TL->getDescriptions()['constructors'][$data['predicate']])) { - $header .= $this->TL->getDescriptions()['constructors'][$data['predicate']]['description'].PHP_EOL.PHP_EOL; + if (isset($this->TL->getDescriptions()['constructors'][$constructor])) { + $header .= $this->TL->getDescriptions()['constructors'][$constructor]['description'].PHP_EOL.PHP_EOL; } - $type = '### Type: ['.\str_replace('_', '\\_', $php_type).'](../types/'.$php_type.'.md) + $type = '### Type: ['.StrTools::markdownEscape($php_type).'](../types/'.$php_type.'.md) '; $example = ''; if (!isset($this->settings['td'])) { - $example = '### Example: - -```php -$'.$constructor.$layer.' = '.$params.'; -``` - - -Or, if you\'re into Lua: - -```lua -'.$constructor.$layer.'='.$lua_params.' - -``` - - -'; + $example = $this->template('constructor-example', $constructor.$layer, $params, $lua_params); if ($hasreplymarkup) { - $example .= ' -## Usage of reply_markup - -You can provide bot API reply_markup objects here. - - -'; + $example .= $this->template('reply_markup'); } if ($hasentities) { - $example .= ' -## Usage of parseMode: - -Set parseMode to html to enable HTML parsing of the message. - -Set parseMode to Markdown to enable markown AND html parsing of the message. - -The following tags are currently supported: - -```html -
a newline -bold works ok, internal tags are stripped -bold -italic -italic -inline fixed-width code -
pre-formatted fixed-width code block
-URL -Mention by username -Mention by user id -
Pre tags can have a language attribute
-``` - -You can also use normal markdown, note that to create mentions you must use the `mention:` syntax like in html: - -```markdown -[Mention by username](mention:@danogentili) -[Mention by user id](mention:186785362) -``` - -MadelineProto supports all html entities supported by [html_entity_decode](http://php.net/manual/en/function.html-entity-decode.php). -'; + $example .= $this->template('parse_mode'); } } \file_put_contents('constructors/'.$constructor.$layer.'.md', $header.$table.$type.$example); @@ -275,19 +214,10 @@ MadelineProto supports all html entities supported by [html_entity_decode](http: $last_namespace = ''; foreach ($this->docs_constructors as $constructor => &$value) { $new_namespace = \preg_replace('/_.*/', '', $constructor); - $br = $new_namespace != $last_namespace ? '*** -

' : ''; + $br = $new_namespace != $last_namespace ? "***\n

" : ''; $value = $br.$value; $last_namespace = $new_namespace; } - \file_put_contents('constructors/'.$this->index, '--- -title: Constructors -description: List of constructors -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# Constructors -[Back to API documentation index](..) - -'.\implode('', $this->docs_constructors)); + \file_put_contents('constructors/'.$this->index, $this->template('constructors-index', \implode('', $this->docs_constructors))); } } diff --git a/src/danog/MadelineProto/DocsBuilder/Methods.php b/src/danog/MadelineProto/DocsBuilder/Methods.php index 81f662fc..cc0094d3 100644 --- a/src/danog/MadelineProto/DocsBuilder/Methods.php +++ b/src/danog/MadelineProto/DocsBuilder/Methods.php @@ -19,6 +19,7 @@ namespace danog\MadelineProto\DocsBuilder; +use danog\MadelineProto\StrTools; use danog\MadelineProto\Tools; trait Methods @@ -56,7 +57,7 @@ trait Methods $this->logger->logger('Generating methods documentation...', \danog\MadelineProto\Logger::NOTICE); foreach ($this->TL->getMethods($this->td)->by_id as $id => $data) { $method = $data['method']; - $php_method = \str_replace('.', '->', $data['method']); + $phpMethod = StrTools::methodEscape($method); $type = \str_replace(['<', '>'], ['_of_', ''], $data['type']); $php_type = \preg_replace('/.*_of_/', '', $type); if (!isset($this->types[$php_type])) { @@ -74,31 +75,31 @@ trait Methods $param['name'] = 'message'; $param['type'] = 'DecryptedMessage'; } - if ($param['name'] === 'chat_id' && $data['method'] !== 'messages.discardEncryption' && !isset($this->settings['td'])) { + if ($param['name'] === 'chat_id' && $method !== 'messages.discardEncryption' && !isset($this->settings['td'])) { $param['type'] = 'InputPeer'; } $type_or_subtype = isset($param['subtype']) ? 'subtype' : 'type'; $type_or_bare_type = \ctype_upper(Tools::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] = '['.Tools::markdownEscape($param[$type_or_subtype]).'](../'.$type_or_bare_type.'/'.$param[$type_or_subtype].'.md)'; + $param[$type_or_subtype] = '['.StrTools::markdownEscape($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]).', '; } - if (!isset($this->td_descriptions['methods'][$data['method']])) { - $this->addToLang('method_'.$data['method']); - if (\danog\MadelineProto\Lang::$lang['en']['method_'.$data['method']] !== '') { - $this->td_descriptions['methods'][$data['method']]['description'] = \danog\MadelineProto\Lang::$lang['en']['method_'.$data['method']]; + if (!isset($this->td_descriptions['methods'][$method])) { + $this->addToLang('method_'.$method); + if (\danog\MadelineProto\Lang::$lang['en']['method_'.$method] !== '') { + $this->td_descriptions['methods'][$method]['description'] = \danog\MadelineProto\Lang::$lang['en']['method_'.$method]; } } - $md_method = '['.$php_method.']('.$method.'.md)'; - $this->docs_methods[$method] = '$MadelineProto->'.$md_method.'(\\['.$params.'\\]) === [$'.\str_replace('_', '\\_', $type).'](../types/'.$php_type.'.md) + $md_method = '['.$phpMethod.']('.$method.'.md)'; + $this->docs_methods[$method] = '$MadelineProto->'.$md_method.'(\\['.$params.'\\]) === [$'.StrTools::markdownEscape($type).'](../types/'.$php_type.'.md) '; - if (isset($this->td_descriptions['methods'][$data['method']])) { - $desc = \Parsedown::instance()->line(\trim(\explode("\n", $this->td_descriptions['methods'][$data['method']]['description'])[0], '.')); + if (isset($this->td_descriptions['methods'][$method])) { + $desc = \Parsedown::instance()->line(\trim(\explode("\n", $this->td_descriptions['methods'][$method]['description'])[0], '.')); $dom = new \DOMDocument(); $dom->loadHTML(\mb_convert_encoding($desc, 'HTML-ENTITIES', 'UTF-8')); $desc = $dom->textContent; - $this->human_docs_methods[$this->td_descriptions['methods'][$data['method']]['description'].': '.$data['method']] = '* '.$desc.': '.$data['method'].' + $this->human_docs_methods[$this->td_descriptions['methods'][$method]['description'].': '.$method] = '* '.$desc.': '.$method.' '; } @@ -111,7 +112,7 @@ trait Methods | Name | Type | Required | |----------|---------------|----------| '; - if (isset($this->td_descriptions['methods'][$data['method']]) && !empty($data['params'])) { + if (isset($this->td_descriptions['methods'][$method]) && !empty($data['params'])) { $table = '### Parameters: | Name | Type | Description | Required | @@ -129,7 +130,7 @@ trait Methods $param['name'] = 'message'; $param['type'] = 'DecryptedMessage'; } - if ($param['name'] === 'chat_id' && $data['method'] !== 'messages.discardEncryption' && !isset($this->settings['td'])) { + if ($param['name'] === 'chat_id' && $method !== 'messages.discardEncryption' && !isset($this->settings['td'])) { $param['type'] = 'InputPeer'; } if ($param['name'] === 'hash' && $param['type'] === 'int') { @@ -163,16 +164,15 @@ trait Methods $human_ptype = 'File path or '.$ptype; } $type_or_bare_type = \ctype_upper(Tools::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'; - if (!isset($this->td_descriptions['methods'][$data['method']]['params'][$param['name']])) { - $this->addToLang('method_'.$data['method'].'_param_'.$param['name'].'_type_'.$param['type']); - if (isset($this->td_descriptions['methods'][$data['method']]['description'])) { - $this->td_descriptions['methods'][$data['method']]['params'][$param['name']] = \danog\MadelineProto\Lang::$lang['en']['method_'.$data['method'].'_param_'.$param['name'].'_type_'.$param['type']]; + if (!isset($this->td_descriptions['methods'][$method]['params'][$param['name']])) { + if (isset($this->td_descriptions['methods'][$method]['description'])) { + $this->td_descriptions['methods'][$method]['params'][$param['name']] = \danog\MadelineProto\Lang::$lang['en']['method_'.$method.'_param_'.$param['name'].'_type_'.$param['type']] ?? ''; } } - if (isset($this->td_descriptions['methods'][$data['method']])) { - $table .= '|'.\str_replace('_', '\\_', $param['name']).'|'.(isset($param['subtype']) ? 'Array of ' : '').'['.\str_replace('_', '\\_', $human_ptype).'](../'.$type_or_bare_type.'/'.$ptype.'.md) | '.$this->td_descriptions['methods'][$data['method']]['params'][$param['name']].' | '.(isset($param['pow']) || ($id = $this->TL->getConstructors($this->td)->findByPredicate(\lcfirst($param['type']).'Empty')) && $id['type'] === $param['type'] || ($id = $this->TL->getConstructors($this->td)->findByPredicate('input'.$param['type'].'Empty')) && $id['type'] === $param['type'] ? 'Optional' : 'Yes').'|'; + if (isset($this->td_descriptions['methods'][$method])) { + $table .= '|'.StrTools::markdownEscape($param['name']).'|'.(isset($param['subtype']) ? 'Array of ' : '').'['.StrTools::markdownEscape($human_ptype).'](../'.$type_or_bare_type.'/'.$ptype.'.md) | '.$this->td_descriptions['methods'][$method]['params'][$param['name']].' | '.(isset($param['pow']) || ($id = $this->TL->getConstructors($this->td)->findByPredicate(\lcfirst($param['type']).'Empty')) && $id['type'] === $param['type'] || ($id = $this->TL->getConstructors($this->td)->findByPredicate('input'.$param['type'].'Empty')) && $id['type'] === $param['type'] ? 'Optional' : 'Yes').'|'; } else { - $table .= '|'.\str_replace('_', '\\_', $param['name']).'|'.(isset($param['subtype']) ? 'Array of ' : '').'['.\str_replace('_', '\\_', $human_ptype).'](../'.$type_or_bare_type.'/'.$ptype.'.md) | '.(isset($param['pow']) || ($id = $this->TL->getConstructors($this->td)->findByPredicate(\lcfirst($param['type']).'Empty')) && $id['type'] === $param['type'] || ($id = $this->TL->getConstructors($this->td)->findByPredicate('input'.$param['type'].'Empty')) && $id['type'] === $param['type'] ? 'Optional' : 'Yes').'|'; + $table .= '|'.StrTools::markdownEscape($param['name']).'|'.(isset($param['subtype']) ? 'Array of ' : '').'['.StrTools::markdownEscape($human_ptype).'](../'.$type_or_bare_type.'/'.$ptype.'.md) | '.(isset($param['pow']) || ($id = $this->TL->getConstructors($this->td)->findByPredicate(\lcfirst($param['type']).'Empty')) && $id['type'] === $param['type'] || ($id = $this->TL->getConstructors($this->td)->findByPredicate('input'.$param['type'].'Empty')) && $id['type'] === $param['type'] ? 'Optional' : 'Yes').'|'; } $table .= PHP_EOL; $pptype = \in_array($ptype, ['string', 'bytes']) ? "'".$ptype."'" : $ptype; @@ -200,128 +200,41 @@ trait Methods $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'; + $description = isset($this->td_descriptions['methods'][$method]) ? $this->td_descriptions['methods'][$method]['description'] : $method.' parameters, return type and example'; $symFile = \str_replace('.', '_', $method); $redir = $symFile !== $method ? "\nredirect_from: /API_docs/methods/{$symFile}.html" : ''; - $header = '--- -title: '.$data['method'].' -description: '.$description.' -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png'.$redir.' ---- -# Method: '.\str_replace('_', '\\_', $data['method']).' -[Back to methods index](index.md) - - -'; - /* - if (isset(\danog\MadelineProto\MTProto::DISALLOWED_METHODS[$data['method']])) { - $header .= '**'.\danog\MadelineProto\MTProto::DISALLOWED_METHODS[$data['method']]."**\n\n\n\n\n"; - file_put_contents('methods/'.$method.'.md', $header); - continue; - }*/ + $header = $this->template('Method', $method, $description, $redir, StrTools::markdownEscape($method)); if ($this->td) { - $header .= 'YOU CANNOT USE THIS METHOD IN MADELINEPROTO - - -'; + $header .= "YOU CANNOT USE THIS METHOD IN MADELINEPROTO\n\n\n\n\n"; } - $header .= isset($this->td_descriptions['methods'][$data['method']]) ? $this->td_descriptions['methods'][$data['method']]['description'].PHP_EOL.PHP_EOL : ''; + $header .= isset($this->td_descriptions['methods'][$method]) ? $this->td_descriptions['methods'][$method]['description'].PHP_EOL.PHP_EOL : ''; $table .= ' '; - $return = '### Return type: ['.\str_replace('_', '\\_', $type).'](../types/'.$php_type.'.md) + $return = '### Return type: ['.StrTools::markdownEscape($type).'](../types/'.$php_type.'.md) '; - $bot = !\in_array($data['method'], $bots); + $bot = !\in_array($method, $bots); $example = ''; if (!isset($this->settings['td'])) { $example .= '### Can bots use this method: **'.($bot ? 'YES' : 'NO')."**\n\n\n"; - $example .= \str_replace('[]', '', '### MadelineProto Example ([now async for huge speed and parallelism!](https://docs.madelineproto.xyz/docs/ASYNC.html)): - - -```php -if (!file_exists(\'madeline.php\')) { - copy(\'https://phar.madelineproto.xyz/madeline.php\', \'madeline.php\'); -} -include \'madeline.php\'; - -$MadelineProto = new \\danog\\MadelineProto\\API(\'session.madeline\'); -$MadelineProto->start(); - -$'.$type.' = $MadelineProto->'.$php_method.'(['.$params.']); -``` - -Or, if you\'re into Lua: - -```lua -'.$type.' = '.$data['method'].'({'.$lua_params.'}) -``` - -'); + $example .= \str_replace('[]', '', $this->template('method-example', $type, $phpMethod, $params, $method, $lua_params)); if ($hasreplymarkup) { - $example .= ' -## Usage of reply_markup - -You can provide bot API reply_markup objects here. - - -'; + $example .= $this->template('reply_markup'); } if ($hasmessage) { - $example .= ' -## Return value - -If the length of the provided message is bigger than 4096, the message will be split in chunks and the method will be called multiple times, with the same parameters (except for the message), and an array of ['.\str_replace('_', '\\_', $type).'](../types/'.$php_type.'.md) will be returned instead. - - -'; + $example .= $this->template('chunks', StrTools::markdownEscape($type), $php_type); } if ($hasentities) { - $example .= ' -## Usage of parseMode: - -Set parseMode to html to enable HTML parsing of the message. - -Set parseMode to Markdown to enable markown AND html parsing of the message. - -The following tags are currently supported: - -```html -
a newline -bold works ok, internal tags are stripped -bold -italic -italic -underline -strikethrough -strikethrough -strikethrough -inline fixed-width code -
pre-formatted fixed-width code block
-
pre-formatted fixed-width code block
-URL -Mention by username -Mention by user id -
Pre tags can have a language attribute
-``` - -You can also use normal markdown, note that to create mentions you must use the `mention:` syntax like in html: - -```markdown -[Mention by username](mention:@danogentili) -[Mention by user id](mention:186785362) -``` - -MadelineProto supports all html entities supported by [html_entity_decode](http://php.net/manual/en/function.html-entity-decode.php). -'; + $example .= $this->template('parse_mode'); } - if (isset($new['result'][$data['method']])) { + if (isset($new['result'][$method])) { $example .= '### Errors | Code | Type | Description | |------|----------|---------------| '; - foreach ($new['result'][$data['method']] as $error) { + foreach ($new['result'][$method] as $error) { [$error, $code] = $error; $example .= "|{$code}|{$error}|".$errors['human_result'][$error][0].'|'."\n"; } @@ -342,75 +255,7 @@ MadelineProto supports all html entities supported by [html_entity_decode](http: $value = $br.$value; $last_namespace = $new_namespace; } - \file_put_contents('methods/api_'.$this->index, '--- -title: Methods -description: List of methods -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# Methods -[Back to API documentation index](..) - -[Go to the new description-version method index]('.$this->index.') - -$MadelineProto->[logout](https://docs.madelineproto.xyz/logout.html)(); - -$MadelineProto->[phoneLogin](https://docs.madelineproto.xyz/phoneLogin.html)($number); - -$MadelineProto->[completePhoneLogin](https://docs.madelineproto.xyz/completePhoneLogin.html)($code); - -$MadelineProto->[complete2FALogin](https://docs.madelineproto.xyz/complete2FAlogin.html)($password); - -$MadelineProto->[botLogin](https://docs.madelineproto.xyz/botLogin.html)($token); - - -$MadelineProto->[getDialogs](https://docs.madelineproto.xyz/getDialogs.html)(); - -$MadelineProto->[getPwrChat](https://docs.madelineproto.xyz/getPwrChat.html)($id); - -$MadelineProto->[getInfo](https://docs.madelineproto.xyz/getInfo.html)($id); - -$MadelineProto->[getFullInfo](https://docs.madelineproto.xyz/getFullInfo.html)($id); - -$MadelineProto->[getSelf](https://docs.madelineproto.xyz/getSelf.html)(); - - -$MadelineProto->[requestCall](https://docs.madelineproto.xyz/requestCall.html)($id); - -$MadelineProto->[requestSecretChat](https://docs.madelineproto.xyz/requestSecretChat.html)($id); - -'.\implode('', $this->docs_methods)); - \file_put_contents('methods/'.$this->index, '--- -title: Methods -description: What do you want to do? -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -# What do you want to do? -[Go back to API documentation index](..) - -[Go to the old code-version method index](api_'.$this->index.') - -* [Logout](https://docs.madelineproto.xyz/logout.html) - -* [Login](https://docs.madelineproto.xyz/docs/LOGIN.html) - -* [Change 2FA password](https://docs.madelineproto.xyz/update2fa.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/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) - -'.\implode('', $this->human_docs_methods)); + \file_put_contents('methods/api_'.$this->index, $this->template('methods-api-index', $this->index, \implode('', $this->docs_methods))); + \file_put_contents('methods/'.$this->index, $this->template('methods-index', $this->index, \implode('', $this->human_docs_methods))); } } diff --git a/src/danog/MadelineProto/InternalDoc.php b/src/danog/MadelineProto/InternalDoc.php index d49a4120..4fd7599e 100644 --- a/src/danog/MadelineProto/InternalDoc.php +++ b/src/danog/MadelineProto/InternalDoc.php @@ -10,13 +10,13 @@ namespace danog\MadelineProto; interface auth { /** - * You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info). + * Send the verification code for login. * * Parameters: - * * `string` **phone_number** - You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) - * * `int` **api_id** - You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) - * * `string` **api_hash** - You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) - * * `CodeSettings` **settings** - You cannot use this method directly, use the phoneLogin method instead (see https://docs.madelineproto.xyz for more info) + * * `string` **phone_number** - Phone number in international format + * * `int` **api_id** - Application identifier (see [App configuration](https://core.telegram.org/myapp)) + * * `string` **api_hash** - Application secret hash (see [App configuration](https://core.telegram.org/myapp)) + * * `CodeSettings` **settings** - Settings for the code type to send * * @param array $params Parameters * @@ -25,13 +25,13 @@ interface auth public function sendCode($params); /** - * You cannot use this method directly, use the completeSignup method instead (see https://docs.madelineproto.xyz for more info). + * Registers a validated phone number in the system. * * Parameters: - * * `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) + * * `string` **phone_number** - Phone number in the international format + * * `string` **phone_code_hash** - SMS-message ID + * * `string` **first_name** - New user first name + * * `string` **last_name** - New user last name * * @param array $params Parameters * @@ -40,12 +40,12 @@ interface auth public function signUp($params); /** - * You cannot use this method directly, use the completePhoneLogin method instead (see https://docs.madelineproto.xyz for more info). + * Signs in a user with a validated phone number. * * Parameters: - * * `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) + * * `string` **phone_number** - Phone number in the international format + * * `string` **phone_code_hash** - SMS-message ID, obtained from [auth.sendCode](https://docs.madelineproto.xyz/API_docs/methods/auth.sendCode.html) + * * `string` **phone_code** - Valid numerical code from the SMS-message * * @param array $params Parameters * @@ -54,7 +54,7 @@ interface auth public function signIn($params); /** - * You cannot use this method directly, use the logout method instead (see https://docs.madelineproto.xyz for more info). + * Logs out the user. * * @return bool */ @@ -70,10 +70,10 @@ interface auth public function resetAuthorizations(); /** - * You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html. + * Returns data for copying authorization to another data-centre. * * Parameters: - * * `int` **dc_id** - You cannot use this method directly, use $MadelineProto->exportAuthorization() instead, see https://docs.madelineproto.xyz/docs/LOGIN.html + * * `int` **dc_id** - Number of a target data-centre * * @param array $params Parameters * @@ -82,11 +82,11 @@ interface auth public function exportAuthorization($params); /** - * You cannot use this method directly, use $MadelineProto->importAuthorization($authorization) instead, see https://docs.madelineproto.xyz/docs/LOGIN.html. + * Logs in a user using a key transmitted from his native data-centre. * * Parameters: - * * `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 + * * `int` **id** - User ID + * * `bytes` **bytes** - Authorization key * * @param array $params Parameters * @@ -95,13 +95,15 @@ interface auth public function importAuthorization($params); /** - * 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. + * Binds a temporary authorization key `temp_auth_key_id` to the permanent authorization key `perm_auth_key_id`. Each permanent key may only be bound to one temporary key at a time, binding a new temporary key overwrites the previous one. + * + * For more information, see [Perfect Forward Secrecy](https://core.telegram.org/api/pfs). * * Parameters: - * * `long` **perm_auth_key_id** - 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 - * * `long` **nonce** - 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 - * * `int` **expires_at** - 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 - * * `bytes` **encrypted_message** - 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 + * * `long` **perm_auth_key_id** - Permanent auth\_key\_id to bind to + * * `long` **nonce** - Random long from [Binding message contents](#binding-message-contents) + * * `int` **expires_at** - Unix timestamp to invalidate temporary key, see [Binding message contents](#binding-message-contents) + * * `bytes` **encrypted_message** - See [Generating encrypted\_message](#generating-encrypted-message) * * @param array $params Parameters * @@ -110,12 +112,12 @@ interface auth public function bindTempAuthKey($params); /** - * You cannot use this method directly, use the botLogin method instead (see https://docs.madelineproto.xyz for more info). + * Login as a bot. * * Parameters: - * * `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) + * * `int` **api_id** - Application identifier (see. [App configuration](https://core.telegram.org/myapp)) + * * `string` **api_hash** - Application identifier hash (see. [App configuration](https://core.telegram.org/myapp)) + * * `string` **bot_auth_token** - Bot token (see [bots](https://core.telegram.org/bots)) * * @param array $params Parameters * @@ -124,10 +126,10 @@ interface auth public function importBotAuthorization($params); /** - * You cannot use this method directly, use the complete2falogin method instead (see https://docs.madelineproto.xyz for more info). + * Try logging to an account protected by a [2FA password](https://core.telegram.org/api/srp). * * Parameters: - * * `InputCheckPasswordSRP` **password** - You cannot use this method directly, use the complete2falogin method instead (see https://docs.madelineproto.xyz for more info) + * * `InputCheckPasswordSRP` **password** - The account's password (see [SRP](https://core.telegram.org/api/srp)) * * @param array $params Parameters * @@ -184,7 +186,7 @@ interface auth * Delete all temporary authorization keys **except for** the ones specified. * * Parameters: - * * `[long]` **except_auth_keys** - The temporary authorization keys to keep + * * `[long]` **except_auth_keys** - The auth keys that **shouldn't** be dropped. * * @param array $params Parameters * @@ -193,12 +195,15 @@ interface auth public function dropTempAuthKeys($params); /** + * Generate a login token, for [login via QR code](https://core.telegram.org/api/qr-login). + * The generated login token should be encoded using base64url, then shown as a `tg://login?token=base64encodedtoken` URL in the QR code. * + * For more info, see [login via QR code](https://core.telegram.org/api/qr-login). * * Parameters: - * * `int` **api_id** - - * * `string` **api_hash** - - * * `[int]` **except_ids** -. + * * `int` **api_id** - Application identifier (see. [App configuration](https://core.telegram.org/myapp)) + * * `string` **api_hash** - Application identifier hash (see. [App configuration](https://core.telegram.org/myapp)) + * * `[int]` **except_ids** - List of already logged-in user IDs, to prevent logging in twice with the same user * * @param array $params Parameters * @@ -207,10 +212,12 @@ interface auth public function exportLoginToken($params); /** + * Login using a redirected login token, generated in case of DC mismatch during [QR code login](https://core.telegram.org/api/qr-login). * + * For more info, see [login via QR code](https://core.telegram.org/api/qr-login). * * Parameters: - * * `bytes` **token** -. + * * `bytes` **token** - Login token * * @param array $params Parameters * @@ -219,10 +226,14 @@ interface auth public function importLoginToken($params); /** + * Accept QR code login token, logging in the app that generated it. * + * Returns info about the new session. + * + * For more info, see [login via QR code](https://core.telegram.org/api/qr-login). * * Parameters: - * * `bytes` **token** -. + * * `bytes` **token** - Login token embedded in QR code, for more info, see [login via QR code](https://core.telegram.org/api/qr-login). * * @param array $params Parameters * @@ -242,7 +253,7 @@ interface account * * `string` **token** - Device token * * `Bool` **app_sandbox** - If [(boolTrue)](https://docs.madelineproto.xyz/API_docs/constructors/boolTrue.html) is transmitted, a sandbox-certificate will be used during transmission. * * `bytes` **secret** - For FCM and APNS VoIP, optional encryption key used to encrypt push notifications - * * `[int]` **other_uids** - Other UIDs + * * `[int]` **other_uids** - List of user identifiers of other users currently using the client * * @param array $params Parameters * @@ -256,7 +267,7 @@ interface account * Parameters: * * `int` **token_type** - Device token type.
**Possible values**:
`1` \- APNS (device token for apple push)
`2` \- FCM (firebase token for google firebase)
`3` \- MPNS (channel URI for microsoft push)
`4` \- Simple push (endpoint for firefox's simple push API)
`5` \- Ubuntu phone (token for ubuntu push)
`6` \- Blackberry (token for blackberry push)
`7` \- Unused
`8` \- WNS (windows push)
`9` \- APNS VoIP (token for apple push VoIP)
`10` \- Web push (web push, see below)
`11` \- MPNS VoIP (token for microsoft push VoIP)
`12` \- Tizen (token for tizen push)

For `10` web push, the token must be a JSON-encoded object containing the keys described in [PUSH updates](https://core.telegram.org/api/push-updates) * * `string` **token** - Device token - * * `[int]` **other_uids** - Other UIDs + * * `[int]` **other_uids** - List of user identifiers of other users currently using the client * * @param array $params Parameters * @@ -326,7 +337,7 @@ interface account * Returns a list of available wallpapers. * * Parameters: - * * `[int]` **hash** - Optional: IDs of previously fetched wallpapers + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -351,7 +362,7 @@ interface account * Validates a username and checks availability. * * Parameters: - * * `string` **username** - Username
Accepted characters: A-z (case-insensitive), 0-9 and underscores.
Length: 5-32 characters. + * * `string` **username** - username
Accepted characters: A-z (case-insensitive), 0-9 and underscores.
Length: 5-32 characters. * * @param array $params Parameters * @@ -363,7 +374,7 @@ interface account * Changes username for the current user. * * Parameters: - * * `string` **username** - Username or empty string if username is to be removed
Accepted characters: a-z (case-insensitive), 0-9 and underscores.
Length: 5-32 characters. + * * `string` **username** - username or empty string if username is to be removed
Accepted characters: a-z (case-insensitive), 0-9 and underscores.
Length: 5-32 characters. * * @param array $params Parameters * @@ -388,7 +399,7 @@ interface account * * Parameters: * * `InputPrivacyKey` **key** - Peers to which the privacy rules apply - * * `[InputPrivacyRule]` **rules** - Privacy settings + * * `[InputPrivacyRule]` **rules** - New privacy rules * * @param array $params Parameters * @@ -493,10 +504,10 @@ interface account public function getPassword(); /** - * You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info). + * Get private info associated to the password info (recovery email, telegram [passport](https://core.telegram.org/passport) info & so on). * * Parameters: - * * `InputCheckPasswordSRP` **password** - You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) + * * `InputCheckPasswordSRP` **password** - The password (see [SRP](https://core.telegram.org/api/srp)) * * @param array $params Parameters * @@ -505,11 +516,11 @@ interface account public function getPasswordSettings($params); /** - * You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info). + * Set a new 2FA password. * * Parameters: - * * `InputCheckPasswordSRP` **password** - You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) - * * `account.PasswordInputSettings` **new_settings** - You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info) + * * `InputCheckPasswordSRP` **password** - The old password (see [SRP](https://core.telegram.org/api/srp)) + * * `account.PasswordInputSettings` **new_settings** - The new password (see [SRP](https://core.telegram.org/api/srp)) * * @param array $params Parameters * @@ -593,7 +604,7 @@ interface account * Get saved [Telegram Passport](https://core.telegram.org/passport) document, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption). * * Parameters: - * * `[SecureValueType]` **types** - Get telegram passport secure parameters + * * `[SecureValueType]` **types** - Requested value types * * @param array $params Parameters * @@ -618,7 +629,7 @@ interface account * Delete stored [Telegram Passport](https://core.telegram.org/passport) documents, [for more info see the passport docs »](https://core.telegram.org/passport/encryption#encryption). * * Parameters: - * * `[SecureValueType]` **types** - The values to delete + * * `[SecureValueType]` **types** - Document types to delete * * @param array $params Parameters * @@ -647,7 +658,7 @@ interface account * * `int` **bot_id** - Bot ID * * `string` **scope** - Telegram Passport element types requested by the service * * `string` **public_key** - Service's public key - * * `[SecureValueHash]` **value_hashes** - Hashes of the encrypted credentials + * * `[SecureValueHash]` **value_hashes** - Types of values sent and their hashes * * `SecureCredentialsEncrypted` **credentials** - Encrypted values * * @param array $params Parameters @@ -899,7 +910,7 @@ interface account * * `string` **slug** - Unique theme ID * * `string` **title** - Theme name * * `InputDocument` **document** - Optional: Theme file - * * `InputThemeSettings` **settings** - Optional: + * * `InputThemeSettings` **settings** - Optional: Theme settings * * @param array $params Parameters * @@ -916,7 +927,7 @@ interface account * * `string` **slug** - Optional: Unique theme ID * * `string` **title** - Optional: Theme name * * `InputDocument` **document** - Optional: Theme file - * * `InputThemeSettings` **settings** - Optional: + * * `InputThemeSettings` **settings** - Optional: Theme settings * * @param array $params Parameters * @@ -970,7 +981,7 @@ interface account * * Parameters: * * `string` **format** - Theme format, a string that identifies the theming engines supported by the client - * * `[int]` **hash** - Optional: Hash for pagination + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -979,10 +990,10 @@ interface account public function getThemes($params); /** - * + * Set sensitive content settings (for viewing or hiding NSFW content). * * Parameters: - * * `boolean` **sensitive_enabled** - Optional:. + * * `boolean` **sensitive_enabled** - Optional: Enable NSFW content * * @param array $params Parameters * @@ -991,17 +1002,17 @@ interface account public function setContentSettings($params); /** - * + * Get sensitive content settings. * * @return account.ContentSettings */ public function getContentSettings(); /** - * + * Get info about multiple wallpapers. * * Parameters: - * * `[InputWallPaper]` **wallpapers** -. + * * `[InputWallPaper]` **wallpapers** - Wallpapers to fetch info about * * @param array $params Parameters * @@ -1016,7 +1027,7 @@ interface users * Returns basic user info according to their identifiers. * * Parameters: - * * `[InputUser]` **id** - The ids of the users + * * `[InputUser]` **id** - List of user identifiers * * @param array $params Parameters * @@ -1025,10 +1036,10 @@ interface users public function getUsers($params); /** - * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info). + * Returns extended user info by ID. * * Parameters: - * * `InputUser` **id** - You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info) + * * `InputUser` **id** - User ID * * @param array $params Parameters * @@ -1043,7 +1054,7 @@ interface users * * Parameters: * * `InputUser` **id** - The user - * * `[SecureValueError]` **errors** - The errors + * * `[SecureValueError]` **errors** - Errors * * @param array $params Parameters * @@ -1058,7 +1069,7 @@ interface contacts * Get contact by telegram IDs. * * Parameters: - * * `[int]` **hash** - Optional: Previously fetched IDs + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -1077,7 +1088,7 @@ interface contacts * Returns the current user's contact list. * * Parameters: - * * `[int]` **hash** - Optional: User IDs of previously cached contacts + * * `[int]` **hash** - Optional: If there already is a full contact list on the client, a [hash](https://core.telegram.org/api/offsets#hash-generation) of a the list of contact IDs in ascending order may be passed in this parameter. If the contact set was not changed, [(contacts.contactsNotModified)](https://docs.madelineproto.xyz/API_docs/constructors/contacts.contactsNotModified.html) will be returned. * * @param array $params Parameters * @@ -1088,8 +1099,10 @@ interface contacts /** * Imports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info. * + * Use [contacts.addContact](https://docs.madelineproto.xyz/API_docs/methods/contacts.addContact.html) to add Telegram contacts without actually using their phone number. + * * Parameters: - * * `[InputContact]` **contacts** - The numbers to import + * * `[InputContact]` **contacts** - List of contacts to import * * @param array $params Parameters * @@ -1101,7 +1114,7 @@ interface contacts * Deletes several contacts from the list. * * Parameters: - * * `[InputUser]` **id** - The contacts to delete + * * `[InputUser]` **id** - User ID list * * @param array $params Parameters * @@ -1113,7 +1126,7 @@ interface contacts * Delete contacts by phone number. * * Parameters: - * * `[string]` **phones** - Phones + * * `[string]` **phones** - Phone numbers * * @param array $params Parameters * @@ -1172,10 +1185,10 @@ interface contacts public function search($params); /** - * You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info). + * Resolve a @username to get peer info. * * Parameters: - * * `string` **username** - You cannot use this method directly, use the resolveUsername, getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info) + * * `string` **username** - @username to resolve * * @param array $params Parameters * @@ -1197,7 +1210,7 @@ interface contacts * * `boolean` **channels** - Optional: Most frequently visited channels * * `int` **offset** - Offset for [pagination](https://core.telegram.org/api/offsets) * * `int` **limit** - Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets) - * * `[int]` **hash** - Optional: Peer IDs of previously cached peers + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -1247,6 +1260,8 @@ interface contacts /** * Add an existing telegram user as contact. * + * Use [contacts.importContacts](https://docs.madelineproto.xyz/API_docs/methods/contacts.importContacts.html) to add contacts by phone number, without knowing their Telegram ID. + * * Parameters: * * `boolean` **add_phone_privacy_exception** - Optional: Allow the other user to see our phone number? * * `InputUser` **id** - Telegram ID of the other user @@ -1276,9 +1291,9 @@ interface contacts * Get contacts near you. * * Parameters: - * * `boolean` **background** - Optional: + * * `boolean` **background** - Optional: While the geolocation of the current user is public, clients should update it in the background every half-an-hour or so, while setting this flag.
Do this only if the new location is more than 1 KM away from the previous one, or if the previous location is unknown. * * `InputGeoPoint` **geo_point** - Geolocation - * * `int` **self_expires** - Optional: + * * `int` **self_expires** - Optional: If set, the geolocation of the current user will be public for the specified number of seconds; pass 0x7fffffff to disable expiry, 0 to make the current geolocation private; if the flag isn't set, no changes will be applied. * * @param array $params Parameters * @@ -1293,7 +1308,7 @@ interface messages * Returns the list of messages by their IDs. * * Parameters: - * * `[InputMessage]` **id** - The IDs of messages to fetch (only for users and normal groups) + * * `[InputMessage]` **id** - Message ID list * * @param array $params Parameters * @@ -1306,12 +1321,12 @@ interface messages * * Parameters: * * `boolean` **exclude_pinned** - Optional: Exclude pinned dialogs - * * `int` **folder_id** - Optional: Folder ID + * * `int` **folder_id** - Optional: [Peer folder ID, for more info click here](https://core.telegram.org/api/folders#peer-folders) * * `int` **offset_date** - [Offsets for pagination, for more info click here](https://core.telegram.org/api/offsets) * * `int` **offset_id** - [Offsets for pagination, for more info click here](https://core.telegram.org/api/offsets) * * `InputPeer` **offset_peer** - [Offset peer for pagination](https://core.telegram.org/api/offsets) * * `int` **limit** - Number of list elements to be returned - * * `[int]` **hash** - Optional: IDs of previously fetched dialogs + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -1325,12 +1340,12 @@ interface messages * Parameters: * * `InputPeer` **peer** - Target peer * * `int` **offset_id** - Only return messages starting from the specified message ID - * * `int` **offset_date** - Only return messages sent after the specified date + * * `int` **offset_date** - Only return messages sent before the specified date * * `int` **add_offset** - Number of list elements to be skipped, negative values are also accepted. * * `int` **limit** - Number of results to return * * `int` **max_id** - If a positive value was transferred, the method will return only messages with IDs less than **max\_id** * * `int` **min_id** - If a positive value was transferred, the method will return only messages with IDs more than **min\_id** - * * `[int]` **hash** - Optional: IDs of messages you already fetched + * * `[int]` **hash** - Optional: [Result hash](https://core.telegram.org/api/offsets) * * @param array $params Parameters * @@ -1353,7 +1368,7 @@ interface messages * * `int` **limit** - [Number of results to return](https://core.telegram.org/api/offsets) * * `int` **max_id** - [Maximum message ID to return](https://core.telegram.org/api/offsets) * * `int` **min_id** - [Minimum message ID to return](https://core.telegram.org/api/offsets) - * * `[int]` **hash** - Optional: The IDs of messages you already fetched + * * `[int]` **hash** - Optional: [Hash](https://core.telegram.org/api/offsets) * * @param array $params Parameters * @@ -1394,7 +1409,7 @@ interface messages * * Parameters: * * `boolean` **revoke** - Optional: Whether to delete messages for all participants of the chat - * * `[int]` **id** - IDs of messages to delete, use channels->deleteMessages for supergroups + * * `[int]` **id** - Message ID list * * @param array $params Parameters * @@ -1439,7 +1454,7 @@ interface messages * * `int` **reply_to_msg_id** - Optional: The message ID to which this message will reply to * * `string` **message** - The message * * `ReplyMarkup` **reply_markup** - Optional: Reply markup for sending bot buttons - * * `[MessageEntity]` **entities** - Optional: Entities to send (for styled text) + * * `[MessageEntity]` **entities** - Optional: Message [entities](https://core.telegram.org/api/entities) for sending styled text * * `int` **schedule_date** - Optional: Scheduled message date for scheduled messages * * @param array $params Parameters @@ -1460,7 +1475,7 @@ interface messages * * `InputMedia` **media** - Attached media * * `string` **message** - Caption * * `ReplyMarkup` **reply_markup** - Optional: Reply markup for bot keyboards - * * `[MessageEntity]` **entities** - Optional: Entities for styled text + * * `[MessageEntity]` **entities** - Optional: Message [entities](https://core.telegram.org/api/entities) for styled text * * `int` **schedule_date** - Optional: Scheduled message date for scheduled messages * * @param array $params Parameters @@ -1478,7 +1493,7 @@ interface messages * * `boolean` **with_my_score** - Optional: When forwarding games, whether to include your score in the game * * `boolean` **grouped** - Optional: Whether the specified messages represent an album (grouped media) * * `InputPeer` **from_peer** - Source of messages - * * `[int]` **id** - The message IDs + * * `[int]` **id** - IDs of messages * * `InputPeer` **to_peer** - Destination peer * * `int` **schedule_date** - Optional: Scheduled message date for scheduled messages * @@ -1517,7 +1532,7 @@ interface messages * * Parameters: * * `InputPeer` **peer** - Peer - * * `[int]` **id** - The messages to report + * * `[int]` **id** - IDs of messages to report * * `ReportReason` **reason** - Why are these messages being reported * * @param array $params Parameters @@ -1530,7 +1545,7 @@ interface messages * Returns chat basic info on their IDs. * * Parameters: - * * `[int]` **id** - The MTProto IDs of chats to fetch info about + * * `[int]` **id** - List of chat IDs * * @param array $params Parameters * @@ -1539,10 +1554,10 @@ interface messages public function getChats($params); /** - * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info). + * Returns full chat info according to its ID. * * Parameters: - * * `InputPeer` **chat_id** - You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info) + * * `InputPeer` **chat_id** - * * @param array $params Parameters * @@ -1554,7 +1569,7 @@ interface messages * Chanages chat name and sends a service message on it. * * Parameters: - * * `InputPeer` **chat_id** - The ID of the chat + * * `InputPeer` **chat_id** - * * `string` **title** - New chat name, different from the old one * * @param array $params Parameters @@ -1567,7 +1582,7 @@ interface messages * Changes chat photo and sends a service message on it. * * Parameters: - * * `InputPeer` **chat_id** - The ID of the chat + * * `InputPeer` **chat_id** - * * `InputChatPhoto` **photo** - Photo to be set * * @param array $params Parameters @@ -1580,7 +1595,7 @@ interface messages * Adds a user to a chat and sends a service message on it. * * Parameters: - * * `InputPeer` **chat_id** - The chat where to invite users + * * `InputPeer` **chat_id** - * * `InputUser` **user_id** - User ID to be added * * `int` **fwd_limit** - Number of last messages to be forwarded * @@ -1594,7 +1609,7 @@ interface messages * Deletes a user from a chat and sends a service message on it. * * Parameters: - * * `InputPeer` **chat_id** - The ID of the chat + * * `InputPeer` **chat_id** - * * `InputUser` **user_id** - User ID to be deleted * * @param array $params Parameters @@ -1607,7 +1622,7 @@ interface messages * Creates a new chat. * * Parameters: - * * `[InputUser]` **users** - The users to add to the chat + * * `[InputUser]` **users** - List of user IDs to be invited * * `string` **title** - Chat name * * @param array $params Parameters @@ -1617,11 +1632,11 @@ interface messages public function createChat($params); /** - * You cannot use this method directly, instead use $MadelineProto->getDhConfig();. + * Returns configuration parameters for Diffie-Hellman key generation. Can also return a random sequence of bytes of required length. * * Parameters: - * * `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(); + * * `int` **version** - Value of the **version** parameter from [messages.dhConfig](https://docs.madelineproto.xyz/API_docs/constructors/messages.dhConfig.html), avialable at the client + * * `int` **random_length** - Length of the required random sequence * * @param array $params Parameters * @@ -1630,11 +1645,11 @@ interface messages public function getDhConfig($params); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats. + * Sends a request to start a secret chat to the user. * * Parameters: - * * `InputUser` **user_id** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats - * * `bytes` **g_a** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats + * * `InputUser` **user_id** - User ID + * * `bytes` **g_a** - `A = g ^ a mod p`, see [Wikipedia](https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) * * @param array $params Parameters * @@ -1643,12 +1658,12 @@ interface messages public function requestEncryption($params); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats. + * Confirms creation of a secret chat. * * Parameters: - * * `InputEncryptedChat` **peer** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats - * * `bytes` **g_b** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats - * * `long` **key_fingerprint** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats + * * `InputEncryptedChat` **peer** - Secret chat ID + * * `bytes` **g_b** - `B = g ^ b mod p`, see [Wikipedia](https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) + * * `long` **key_fingerprint** - 64-bit fingerprint of the received key * * @param array $params Parameters * @@ -1657,10 +1672,10 @@ interface messages public function acceptEncryption($params); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats. + * Cancels a request for creation and/or delete info on secret chat. * * Parameters: - * * `int` **chat_id** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling secret chats + * * `int` **chat_id** - Secret chat ID * * @param array $params Parameters * @@ -1699,7 +1714,7 @@ interface messages * * Parameters: * * `InputEncryptedChat` **peer** - Secret chat ID - * * `DecryptedMessage` **message** - The message to send + * * `DecryptedMessage` **message** - * * @param array $params Parameters * @@ -1712,7 +1727,7 @@ interface messages * * Parameters: * * `InputEncryptedChat` **peer** - Secret chat ID - * * `DecryptedMessage` **message** - The message with the file + * * `DecryptedMessage` **message** - * * `InputEncryptedFile` **file** - File attachment for the secret chat * * @param array $params Parameters @@ -1726,7 +1741,7 @@ interface messages * * Parameters: * * `InputEncryptedChat` **peer** - Secret chat ID - * * `DecryptedMessage` **message** - The service message + * * `DecryptedMessage` **message** - * * @param array $params Parameters * @@ -1735,10 +1750,10 @@ interface messages public function sendEncryptedService($params); /** - * You cannot use this method directly. + * Confirms receipt of messages in a secret chat by client, cancels push notifications. * * Parameters: - * * `int` **max_qts** - You cannot use this method directly + * * `int` **max_qts** - Maximum qts value available at the client * * @param array $params Parameters * @@ -1762,7 +1777,7 @@ interface messages * Notifies the sender about the recipient having listened a voice message or watched a video. * * Parameters: - * * `[int]` **id** - The messages to mark as read (only users and normal chats, not supergroups) + * * `[int]` **id** - Message ID list * * @param array $params Parameters * @@ -1775,7 +1790,7 @@ interface messages * * Parameters: * * `string` **emoticon** - The emoji - * * `[int]` **hash** - Optional: the hash parameter of the previous result of this method + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -1787,7 +1802,7 @@ interface messages * Get all installed stickers. * * Parameters: - * * `[int]` **hash** - Optional: The hash parameter of the previous result of this method + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -1800,7 +1815,7 @@ interface messages * * Parameters: * * `string` **message** - Message from which to extract the preview - * * `[MessageEntity]` **entities** - Optional: Entities for styled text + * * `[MessageEntity]` **entities** - Optional: [Message entities for styled text](https://core.telegram.org/api/entities) * * @param array $params Parameters * @@ -1900,7 +1915,7 @@ interface messages * * Parameters: * * `InputPeer` **peer** - Peer where the message was found - * * `[int]` **id** - The IDs messages to get + * * `[int]` **id** - ID of message * * `Bool` **increment** - Whether to mark the message as viewed and increment the view counter * * @param array $params Parameters @@ -1913,7 +1928,7 @@ interface messages * Make a user admin in a [legacy group](https://core.telegram.org/api/channel). * * Parameters: - * * `InputPeer` **chat_id** - The chat ID (no supergroups) + * * `InputPeer` **chat_id** - * * `InputUser` **user_id** - The user to make admin * * `Bool` **is_admin** - Whether to make him admin * @@ -1927,7 +1942,7 @@ interface messages * Turn a [legacy group into a supergroup](https://core.telegram.org/api/channel). * * Parameters: - * * `InputPeer` **chat_id** - The chat to convert + * * `InputPeer` **chat_id** - * * @param array $params Parameters * @@ -1939,7 +1954,7 @@ interface messages * Search for messages and peers globally. * * Parameters: - * * `int` **folder_id** - Optional: Folder where to search + * * `int` **folder_id** - Optional: [Peer folder ID, for more info click here](https://core.telegram.org/api/folders#peer-folders) * * `string` **q** - Query * * `int` **offset_rate** - Initially 0, then set to the [`next_rate` parameter of messages.messagesSlice](https://docs.madelineproto.xyz/API_docs/constructors/messages.messagesSlice.html) * * `InputPeer` **offset_peer** - [Offsets for pagination, for more info click here](https://core.telegram.org/api/offsets) @@ -1957,7 +1972,7 @@ interface messages * * Parameters: * * `boolean` **masks** - Optional: Reorder mask stickersets - * * `[long]` **order** - The order + * * `[long]` **order** - New stickerset order by stickerset IDs * * @param array $params Parameters * @@ -1996,7 +2011,7 @@ interface messages * Get saved GIFs. * * Parameters: - * * `[int]` **hash** - Optional: the hash parameter of the previous result of this method + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2040,7 +2055,7 @@ interface messages * * `boolean` **gallery** - Optional: Set this flag if the results are composed of media files * * `boolean` **private** - Optional: Set this flag if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query * * `long` **query_id** - Unique identifier for the answered query - * * `[InputBotInlineResult]` **results** - Results + * * `[InputBotInlineResult]` **results** - Vector of results for the inline query * * `int` **cache_time** - The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. * * `string` **next_offset** - Optional: Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. * * `InlineBotSwitchPM` **switch_pm** - Optional: If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with a certain parameter. @@ -2094,7 +2109,7 @@ interface messages * * `string` **message** - Optional: New message * * `InputMedia` **media** - Optional: New attached media * * `ReplyMarkup` **reply_markup** - Optional: Reply markup for inline keyboards - * * `[MessageEntity]` **entities** - Optional: The new entities (for styled text) + * * `[MessageEntity]` **entities** - Optional: [Message entities for styled text](https://core.telegram.org/api/entities) * * `int` **schedule_date** - Optional: Scheduled message date for scheduled messages * * @param array $params Parameters @@ -2112,7 +2127,7 @@ interface messages * * `string` **message** - Optional: Message * * `InputMedia` **media** - Optional: Media * * `ReplyMarkup` **reply_markup** - Optional: Reply markup for inline keyboards - * * `[MessageEntity]` **entities** - Optional: The new entities (for styled text) + * * `[MessageEntity]` **entities** - Optional: [Message entities for styled text](https://core.telegram.org/api/entities) * * @param array $params Parameters * @@ -2155,7 +2170,7 @@ interface messages * Get dialog info of specified peers. * * Parameters: - * * `[InputDialogPeer]` **peers** - The peers + * * `[InputDialogPeer]` **peers** - Peers * * @param array $params Parameters * @@ -2171,7 +2186,7 @@ interface messages * * `int` **reply_to_msg_id** - Optional: Message ID the message should reply to * * `InputPeer` **peer** - Destination of the message that should be sent * * `string` **message** - The draft - * * `[MessageEntity]` **entities** - Optional: The entities (for styled text) + * * `[MessageEntity]` **entities** - Optional: Message [entities](https://core.telegram.org/api/entities) for styled text * * @param array $params Parameters * @@ -2190,7 +2205,7 @@ interface messages * Get featured stickers. * * Parameters: - * * `[int]` **hash** - Optional: the hash parameter of the previous result of this method + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2202,7 +2217,7 @@ interface messages * Mark new featured stickers as read. * * Parameters: - * * `[long]` **id** - The stickers to mark as read + * * `[long]` **id** - IDs of stickersets to mark as read * * @param array $params Parameters * @@ -2215,7 +2230,7 @@ interface messages * * Parameters: * * `boolean` **attached** - Optional: Get stickers recently attached to photo or video files - * * `[int]` **hash** - Optional: IDs the hash parameter of the previous result of this method + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2267,7 +2282,7 @@ interface messages * Get installed mask stickers. * * Parameters: - * * `[int]` **hash** - Optional: the hash parameter of the previous result of this method + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2365,7 +2380,7 @@ interface messages * Get all chats, channels and supergroups. * * Parameters: - * * `[int]` **except_ids** - Do not fetch these chats (MTProto id) + * * `[int]` **except_ids** - Except these chats/channels/supergroups * * @param array $params Parameters * @@ -2378,7 +2393,7 @@ interface messages * * Parameters: * * `string` **url** - URL of IV page to fetch - * * `[int]` **hash** - Optional: the hash parameter of the previous result of this method + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2404,8 +2419,8 @@ interface messages * * Parameters: * * `boolean` **force** - Optional: If set, dialogs pinned server-side but not present in the `order` field will be unpinned. - * * `int` **folder_id** - Folder ID - * * `[InputDialogPeer]` **order** - New order + * * `int` **folder_id** - [Peer folder ID, for more info click here](https://core.telegram.org/api/folders#peer-folders) + * * `[InputDialogPeer]` **order** - New dialog order * * @param array $params Parameters * @@ -2417,7 +2432,7 @@ interface messages * Get pinned dialogs. * * Parameters: - * * `int` **folder_id** - Folder ID + * * `int` **folder_id** - [Peer folder ID, for more info click here](https://core.telegram.org/api/folders#peer-folders) * * @param array $params Parameters * @@ -2431,7 +2446,7 @@ interface messages * Parameters: * * `long` **query_id** - Unique identifier for the query to be answered * * `string` **error** - Optional: Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. - * * `[ShippingOption]` **shipping_options** - Optional: Shipping options + * * `[ShippingOption]` **shipping_options** - Optional: A vector of available shipping options. * * @param array $params Parameters * @@ -2485,7 +2500,7 @@ interface messages * Get faved stickers. * * Parameters: - * * `[int]` **hash** - Optional: the hash parameter of the previous result of this method + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2541,7 +2556,7 @@ interface messages * Parameters: * * `InputPeer` **peer** - User * * `int` **limit** - Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets) - * * `[int]` **hash** - Optional: IDs of locations you already fetched + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2558,7 +2573,7 @@ interface messages * * `boolean` **clear_draft** - Optional: Whether to clear [drafts](https://core.telegram.org/api/drafts) * * `InputPeer` **peer** - The destination chat * * `int` **reply_to_msg_id** - Optional: The message to reply to - * * `[InputSingleMedia]` **multi_media** - The album + * * `[InputSingleMedia]` **multi_media** - The medias to send * * `int` **schedule_date** - Optional: Scheduled message date for scheduled messages * * @param array $params Parameters @@ -2586,7 +2601,7 @@ interface messages * Parameters: * * `boolean` **exclude_featured** - Optional: Exclude featured stickersets from results * * `string` **q** - Query string - * * `[int]` **hash** - Optional: The IDs of stickersets you already fetched + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2648,7 +2663,7 @@ interface messages * Parameters: * * `InputPeer` **peer** - The chat where the poll was sent * * `int` **msg_id** - The message ID of the poll - * * `[bytes]` **options** - Options + * * `[bytes]` **options** - The options that were chosen * * @param array $params Parameters * @@ -2775,7 +2790,7 @@ interface messages * * Parameters: * * `InputPeer` **peer** - Peer where to search - * * `[MessagesFilter]` **filters** - Filters + * * `[MessagesFilter]` **filters** - Search filters * * @param array $params Parameters * @@ -2829,7 +2844,7 @@ interface messages * * Parameters: * * `InputPeer` **peer** - Peer - * * `[int]` **hash** - Optional: Hash + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -2842,7 +2857,7 @@ interface messages * * Parameters: * * `InputPeer` **peer** - Peer - * * `[int]` **id** - ID + * * `[int]` **id** - IDs of scheduled messages * * @param array $params Parameters * @@ -2855,7 +2870,7 @@ interface messages * * Parameters: * * `InputPeer` **peer** - Peer - * * `[int]` **id** - ID + * * `[int]` **id** - Scheduled message IDs * * @param array $params Parameters * @@ -2868,7 +2883,7 @@ interface messages * * Parameters: * * `InputPeer` **peer** - Peer - * * `[int]` **id** - ID + * * `[int]` **id** - Scheduled message IDs * * @param array $params Parameters * @@ -2877,14 +2892,14 @@ interface messages public function deleteScheduledMessages($params); /** - * + * Get poll results for non-anonymous polls. * * Parameters: - * * `InputPeer` **peer** - - * * `int` **id** - - * * `bytes` **option** - Optional: - * * `string` **offset** - Optional: - * * `int` **limit** -. + * * `InputPeer` **peer** - Chat where the poll was sent + * * `int` **id** - Message ID + * * `bytes` **option** - Optional: Get only results for the specified poll `option` + * * `string` **offset** - Optional: Offset for results, taken from the `next_offset` field of [messages.votesList](https://docs.madelineproto.xyz/API_docs/constructors/messages.votesList.html), initially an empty string.
Note: if no more results are available, the method call will return an empty `next_offset`; thus, avoid providing the `next_offset` returned in [messages.votesList](https://docs.madelineproto.xyz/API_docs/constructors/messages.votesList.html) if it is empty, to avoid an infinite loop. + * * `int` **limit** - Number of results to return * * @param array $params Parameters * @@ -2893,13 +2908,13 @@ interface messages public function getPollVotes($params); /** - * + * Apply changes to multiple stickersets. * * Parameters: - * * `boolean` **uninstall** - Optional: - * * `boolean` **archive** - Optional: - * * `boolean` **unarchive** - Optional: - * * `[InputStickerSet]` **stickersets** -. + * * `boolean` **uninstall** - Optional: Uninstall the specified stickersets + * * `boolean` **archive** - Optional: Archive the specified stickersets + * * `boolean` **unarchive** - Optional: Unarchive the specified stickersets + * * `[InputStickerSet]` **stickersets** - Stickersets to act upon * * @param array $params Parameters * @@ -2908,25 +2923,25 @@ interface messages public function toggleStickerSets($params); /** - * + * Get [folders](https://core.telegram.org/api/folders). * * @return of DialogFilter[] */ public function getDialogFilters(); /** - * + * Get [suggested folders](https://core.telegram.org/api/folders). * * @return of DialogFilterSuggested[] */ public function getSuggestedDialogFilters(); /** - * + * Update [folder](https://core.telegram.org/api/folders). * * Parameters: - * * `int` **id** - - * * `DialogFilter` **filter** - Optional:. + * * `int` **id** - [Folder](https://core.telegram.org/api/folders) ID + * * `DialogFilter` **filter** - Optional: [Folder](https://core.telegram.org/api/folders) info * * @param array $params Parameters * @@ -2935,35 +2950,49 @@ interface messages public function updateDialogFilter($params); /** - * + * Reorder [folders](https://core.telegram.org/api/folders). * * Parameters: - * * `[int]` **order** -. + * * `[int]` **order** - New [folder](https://core.telegram.org/api/folders) order * * @param array $params Parameters * * @return bool */ public function updateDialogFiltersOrder($params); + + /** + * Method for fetching previously featured stickers. + * + * Parameters: + * * `int` **offset** - Offset + * * `int` **limit** - Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets) + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) + * + * @param array $params Parameters + * + * @return messages.FeaturedStickers + */ + public function getOldFeaturedStickers($params); } interface updates { /** - * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates. + * Returns a current state of updates. * * @return updates.State */ public function getState(); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates. + * Get new [updates](https://core.telegram.org/api/updates). * * Parameters: - * * `int` **pts** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates - * * `int` **pts_total_limit** - Optional: You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates - * * `int` **date** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates - * * `int` **qts** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates + * * `int` **pts** - PTS, see [updates](https://core.telegram.org/api/updates). + * * `int` **pts_total_limit** - Optional: For fast updating: if provided and `pts + pts_total_limit < remote pts`, [updates.differenceTooLong](https://docs.madelineproto.xyz/API_docs/constructors/updates.differenceTooLong.html) will be returned.
Simply tells the server to not return the difference if it is bigger than `pts_total_limit`
If the remote pts is too big (> ~4000000), this field will default to 1000000 + * * `int` **date** - date, see [updates](https://core.telegram.org/api/updates). + * * `int` **qts** - QTS, see [updates](https://core.telegram.org/api/updates). * * @param array $params Parameters * @@ -2972,14 +3001,14 @@ interface updates public function getDifference($params); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates. + * Returns the difference between the current state of updates of a certain channel and transmitted. * * Parameters: - * * `boolean` **force** - Optional: You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates - * * `InputChannel` **channel** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates - * * `ChannelMessagesFilter` **filter** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates - * * `int` **pts** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates - * * `int` **limit** - You cannot use this method directly, see https://docs.madelineproto.xyz for more info on handling updates + * * `boolean` **force** - Optional: Set to true to skip some possibly unneeded updates and reduce server-side load + * * `InputChannel` **channel** - The channel + * * `ChannelMessagesFilter` **filter** - Messsage filter + * * `int` **pts** - Persistent timestamp (see [updates](https://core.telegram.org/api/updates)) + * * `int` **limit** - How many updates to fetch, max `100000`
Ordinary (non-bot) users are supposed to pass `10-100` * * @param array $params Parameters * @@ -3018,7 +3047,7 @@ interface photos * Deletes profile photos. * * Parameters: - * * `[InputPhoto]` **id** - The profile photos to delete + * * `[InputPhoto]` **id** - Input photos to delete * * @param array $params Parameters * @@ -3045,12 +3074,12 @@ interface photos interface upload { /** - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. + * Saves a part of file for futher sending to one of the methods. * * Parameters: - * * `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 + * * `long` **file_id** - Random file identifier created by the client + * * `int` **file_part** - Numerical order of a part + * * `bytes` **bytes** - Binary data, contend of a part * * @param array $params Parameters * @@ -3059,14 +3088,14 @@ interface upload public function saveFilePart($params); /** - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. + * Returns content of a whole file or its part. * * Parameters: - * * `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 - * * `boolean` **cdn_supported** - Optional: - * * `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 + * * `boolean` **precise** - Optional: Disable some checks on limit and offset values, useful for example to stream videos by keyframes + * * `boolean` **cdn_supported** - Optional: Whether the current client supports [CDN downloads](https://core.telegram.org/cdn) + * * `InputFileLocation` **location** - File location + * * `int` **offset** - Number of bytes to be skipped + * * `int` **limit** - Number of bytes to be returned * * @param array $params Parameters * @@ -3075,13 +3104,13 @@ interface upload public function getFile($params); /** - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. + * Saves a part of a large file (over 10Mb in size) to be later passed to one of the methods. * * Parameters: - * * `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 + * * `long` **file_id** - Random file id, created by the client + * * `int` **file_part** - Part sequence number + * * `int` **file_total_parts** - Total number of parts + * * `bytes` **bytes** - Binary data, part contents * * @param array $params Parameters * @@ -3104,12 +3133,12 @@ interface upload public function getWebFile($params); /** - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. + * Download a [CDN](https://core.telegram.org/cdn) file. * * Parameters: - * * `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 + * * `bytes` **file_token** - File token + * * `int` **offset** - Offset of chunk to download + * * `int` **limit** - Length of chunk to download * * @param array $params Parameters * @@ -3118,11 +3147,11 @@ interface upload public function getCdnFile($params); /** - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. + * Request a reupload of a certain file to a [CDN DC](https://core.telegram.org/cdn). * * Parameters: - * * `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 + * * `bytes` **file_token** - File token + * * `bytes` **request_token** - Request token * * @param array $params Parameters * @@ -3131,11 +3160,11 @@ interface upload public function reuploadCdnFile($params); /** - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. + * Get SHA256 hashes for verifying downloaded [CDN](https://core.telegram.org/cdn) files. * * Parameters: - * * `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 + * * `bytes` **file_token** - File + * * `int` **offset** - Offset from which to start getting hashes * * @param array $params Parameters * @@ -3144,11 +3173,11 @@ interface upload public function getCdnFileHashes($params); /** - * You cannot use this method directly, use the upload, downloadToStream, downloadToFile, downloadToDir methods instead; see https://docs.madelineproto.xyz for more info. + * Get SHA256 hashes for verifying downloaded files. * * Parameters: - * * `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 + * * `InputFileLocation` **location** - File + * * `int` **offset** - Offset from which to get file hashes * * @param array $params Parameters * @@ -3160,7 +3189,7 @@ interface upload interface help { /** - * Returns current configuration, icluding data center configuration. + * Returns current configuration, including data center configuration. * * @return Config */ @@ -3186,7 +3215,7 @@ interface help public function getAppUpdate($params); /** - * Returns text of a text message with an invitation. + * Returns localized text of a text message with an invitation. * * @return help.InviteText */ @@ -3201,6 +3230,7 @@ interface help /** * Get changelog of current app. + * Typically, an [updates](https://docs.madelineproto.xyz/API_docs/constructors/updates.html) constructor will be returned, containing one or more [updateServiceNotification](https://docs.madelineproto.xyz/API_docs/constructors/updateServiceNotification.html) updates with app-specific changelogs. * * Parameters: * * `string` **prev_app_version** - Previous app version @@ -3243,13 +3273,6 @@ interface help */ public function getRecentMeUrls($params); - /** - * Get promotion info of the currently-used MTProxy. - * - * @return help.ProxyData - */ - public function getProxyData(); - /** * Look for updates of telegram's terms of service. * @@ -3282,7 +3305,7 @@ interface help public function getDeepLinkInfo($params); /** - * Get app-specific configuration. + * Get app-specific configuration, see [client configuration](https://core.telegram.org/api/config#client-configuration) for more info on the result. * * @return JSONValue */ @@ -3292,7 +3315,7 @@ interface help * Saves logs of application on the server. * * Parameters: - * * `[InputAppEvent]` **events** - Event list + * * `[InputAppEvent]` **events** - List of input events * * @param array $params Parameters * @@ -3304,7 +3327,7 @@ interface help * Get [passport](https://core.telegram.org/passport) configuration. * * Parameters: - * * `[int]` **hash** - Optional: Hash + * * `[int]` **hash** - Optional: [Hash for pagination, for more info click here](https://core.telegram.org/api/offsets#hash-generation) * * @param array $params Parameters * @@ -3337,13 +3360,32 @@ interface help * Parameters: * * `InputUser` **user_id** - User * * `string` **message** - Message - * * `[MessageEntity]` **entities** - Entities + * * `[MessageEntity]` **entities** - [Message entities for styled text](https://core.telegram.org/api/entities) * * @param array $params Parameters * * @return help.UserInfo */ public function editUserInfo($params); + + /** + * Get MTProxy/Public Service Announcement information. + * + * @return help.PromoData + */ + public function getPromoData(); + + /** + * Hide MTProxy/Public Service Announcement information. + * + * Parameters: + * * `InputPeer` **peer** - Peer to hide + * + * @param array $params Parameters + * + * @return bool + */ + public function hidePromoData($params); } interface channels @@ -3366,7 +3408,7 @@ interface channels * * Parameters: * * `InputChannel` **channel** - [Channel/supergroup](https://core.telegram.org/api/channel) - * * `[int]` **id** - The IDs of messages to delete + * * `[int]` **id** - IDs of messages to delete * * @param array $params Parameters * @@ -3393,7 +3435,7 @@ interface channels * Parameters: * * `InputChannel` **channel** - Supergroup * * `InputUser` **user_id** - ID of the user that sent the spam messages - * * `[int]` **id** - The IDs of messages to report + * * `[int]` **id** - IDs of spam messages * * @param array $params Parameters * @@ -3406,7 +3448,7 @@ interface channels * * Parameters: * * `InputChannel` **channel** - Channel/supergroup - * * `[InputMessage]` **id** - The message IDs + * * `[InputMessage]` **id** - IDs of messages to get * * @param array $params Parameters * @@ -3422,7 +3464,7 @@ interface channels * * `ChannelParticipantsFilter` **filter** - Which participant types to fetch * * `int` **offset** - [Offset](https://core.telegram.org/api/offsets) * * `int` **limit** - [Limit](https://core.telegram.org/api/offsets) - * * `[int]` **hash** - Optional: IDs of previously fetched participants + * * `[int]` **hash** - Optional: [Hash](https://core.telegram.org/api/offsets) * * @param array $params Parameters * @@ -3447,7 +3489,7 @@ interface channels * Get info about [channels/supergroups](https://core.telegram.org/api/channel). * * Parameters: - * * `[InputChannel]` **id** - The channel/supergroup MTProto IDs + * * `[InputChannel]` **id** - IDs of channels/supergroups to get info about * * @param array $params Parameters * @@ -3456,10 +3498,10 @@ interface channels public function getChannels($params); /** - * You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info). + * Get full info about a channel. * * Parameters: - * * `InputChannel` **channel** - You cannot use this method directly, use the getPwrChat, getInfo, getFullInfo methods instead (see https://docs.madelineproto.xyz for more info) + * * `InputChannel` **channel** - The channel to get info about * * @param array $params Parameters * @@ -3580,7 +3622,7 @@ interface channels * * Parameters: * * `InputChannel` **channel** - Channel/supergroup - * * `[InputUser]` **users** - The users to add + * * `[InputUser]` **users** - Users to invite * * @param array $params Parameters * @@ -3661,7 +3703,7 @@ interface channels * * `InputChannel` **channel** - Channel * * `string` **q** - Search query, can be empty * * `ChannelAdminLogEventsFilter` **events_filter** - Optional: Event filter - * * `[InputUser]` **admins** - Optional: Fetch only actions from these admins + * * `[InputUser]` **admins** - Optional: Only show events from these admins * * `long` **max_id** - Maximum ID of message to return (see [pagination](https://core.telegram.org/api/offsets)) * * `long` **min_id** - Minimum ID of message to return (see [pagination](https://core.telegram.org/api/offsets)) * * `int` **limit** - Maximum number of results to return, [see pagination](https://core.telegram.org/api/offsets) @@ -3690,7 +3732,7 @@ interface channels * * Parameters: * * `InputChannel` **channel** - [Channel/supergroup](https://core.telegram.org/api/channel) - * * `[int]` **id** - List of message IDs + * * `[int]` **id** - IDs of messages whose contents should be marked as read * * @param array $params Parameters * @@ -3798,7 +3840,7 @@ interface channels public function toggleSlowMode($params); /** - * + * Get inactive channels and supergroups. * * @return messages.InactiveChats */ @@ -3832,6 +3874,18 @@ interface bots * @return bool */ public function answerWebhookJSONQuery($params); + + /** + * Set bot command list. + * + * Parameters: + * * `[BotCommand]` **commands** - Bot commands + * + * @param array $params Parameters + * + * @return bool + */ + public function setBotCommands($params); } interface payments @@ -3910,10 +3964,10 @@ interface payments public function clearSavedInfo($params); /** - * + * Get info about a credit card. * * Parameters: - * * `string` **number** -. + * * `string` **number** - Credit card number * * @param array $params Parameters * @@ -3929,10 +3983,12 @@ interface stickers * * Parameters: * * `boolean` **masks** - Optional: Whether this is a mask stickerset + * * `boolean` **animated** - Optional: Whether this is an animated stickerset * * `InputUser` **user_id** - Stickerset owner * * `string` **title** - Stickerset name, `1-64` chars * * `string` **short_name** - Sticker set name. Can contain only English letters, digits and underscores. Must end with *"*by*"* (** is case insensitive); 1-64 characters - * * `[InputStickerSetItem]` **stickers** - The stickers to add + * * `InputDocument` **thumb** - Optional: Thumbnail + * * `[InputStickerSetItem]` **stickers** - Stickers * * @param array $params Parameters * @@ -3977,6 +4033,19 @@ interface stickers * @return messages.StickerSet */ public function addStickerToSet($params); + + /** + * Set stickerset thumbnail. + * + * Parameters: + * * `InputStickerSet` **stickerset** - Stickerset + * * `InputDocument` **thumb** - Thumbnail + * + * @param array $params Parameters + * + * @return messages.StickerSet + */ + public function setStickerSetThumb($params); } interface phone @@ -3989,13 +4058,13 @@ interface phone public function getCallConfig(); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls. + * Start a telegram phone call. * * Parameters: - * * `boolean` **video** - Optional: You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `InputUser` **user_id** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `bytes` **g_a_hash** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `PhoneCallProtocol` **protocol** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls + * * `boolean` **video** - Optional: Whether to start a video call + * * `InputUser` **user_id** - Destination of the phone call + * * `bytes` **g_a_hash** - [Parameter for E2E encryption key exchange »](https://core.telegram.org/api/end-to-end/voice-calls) + * * `PhoneCallProtocol` **protocol** - Phone call settings * * @param array $params Parameters * @@ -4004,12 +4073,12 @@ interface phone public function requestCall($params); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls. + * Accept incoming call. * * Parameters: - * * `InputPhoneCall` **peer** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `bytes` **g_b** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `PhoneCallProtocol` **protocol** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls + * * `InputPhoneCall` **peer** - The call to accept + * * `bytes` **g_b** - [Parameter for E2E encryption key exchange »](https://core.telegram.org/api/end-to-end/voice-calls) + * * `PhoneCallProtocol` **protocol** - Phone call settings * * @param array $params Parameters * @@ -4018,13 +4087,13 @@ interface phone public function acceptCall($params); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls. + * [Complete phone call E2E encryption key exchange »](https://core.telegram.org/api/end-to-end/voice-calls). * * Parameters: - * * `InputPhoneCall` **peer** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `bytes` **g_a** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `long` **key_fingerprint** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `PhoneCallProtocol` **protocol** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls + * * `InputPhoneCall` **peer** - The phone call + * * `bytes` **g_a** - [Parameter for E2E encryption key exchange »](https://core.telegram.org/api/end-to-end/voice-calls) + * * `long` **key_fingerprint** - Key fingerprint + * * `PhoneCallProtocol` **protocol** - Phone call settings * * @param array $params Parameters * @@ -4045,14 +4114,14 @@ interface phone public function receivedCall($params); /** - * You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls. + * Refuse or end running call. * * Parameters: - * * `boolean` **video** - Optional: You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `InputPhoneCall` **peer** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `int` **duration** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `PhoneCallDiscardReason` **reason** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls - * * `long` **connection_id** - You cannot use this method directly, see https://docs.madelineproto.xyz#calls for more info on handling calls + * * `boolean` **video** - Optional: Whether this is a video call + * * `InputPhoneCall` **peer** - The phone call + * * `int` **duration** - Call duration + * * `PhoneCallDiscardReason` **reason** - Why was the call discarded + * * `long` **connection_id** - Preferred libtgvoip relay ID * * @param array $params Parameters * @@ -4110,7 +4179,7 @@ interface langpack * Parameters: * * `string` **lang_pack** - Language pack name * * `string` **lang_code** - Language code - * * `[string]` **keys** - Keys + * * `[string]` **keys** - Strings to get * * @param array $params Parameters * @@ -4161,10 +4230,10 @@ interface langpack interface folders { /** - * Edit peers in folder. + * Edit peers in [peer folder](https://core.telegram.org/api/folders#peer-folders). * * Parameters: - * * `[InputFolderPeer]` **folder_peers** - New folder peers + * * `[InputFolderPeer]` **folder_peers** - New peer list * * @param array $params Parameters * @@ -4173,10 +4242,10 @@ interface folders public function editPeerFolders($params); /** - * Delete a folder. + * Delete a [peer folder](https://core.telegram.org/api/folders#peer-folders). * * Parameters: - * * `int` **folder_id** - Folder to delete + * * `int` **folder_id** - [Peer folder ID, for more info click here](https://core.telegram.org/api/folders#peer-folders) * * @param array $params Parameters * @@ -4188,11 +4257,11 @@ interface folders interface stats { /** - * + * Get [channel statistics](https://core.telegram.org/api/stats). * * Parameters: - * * `boolean` **dark** - Optional: - * * `InputChannel` **channel** -. + * * `boolean` **dark** - Optional: Whether to enable dark theme for graph colors + * * `InputChannel` **channel** - The channel * * @param array $params Parameters * @@ -4201,11 +4270,11 @@ interface stats public function getBroadcastStats($params); /** - * + * Load [channel statistics graph](https://core.telegram.org/api/stats) asynchronously. * * Parameters: - * * `string` **token** - - * * `long` **x** - Optional:. + * * `string` **token** - Graph token from [statsGraphAsync](https://docs.madelineproto.xyz/API_docs/constructors/statsGraphAsync.html) constructor + * * `long` **x** - Optional: Zoom value, if required * * @param array $params Parameters * @@ -4285,12 +4354,12 @@ class InternalDoc extends APIFactory * * @param array $user User info * - * @return \Generator - * @throws Exception + * @return \Generator + * @throws \danog\MadelineProto\Exception */ - public function addUser(array $user): \Generator + public function addUser(array $user, array $extra = []) { - yield from $this->API->addUser($user); + return $this->__call(__FUNCTION__, [$user, $extra]); } /** * Call promise $b after promise $a. @@ -4298,6 +4367,8 @@ class InternalDoc extends APIFactory * @param \Generator|Promise $a Promise A * @param \Generator|Promise $b Promise B * + * @psalm-suppress InvalidScope + * * @return Promise */ public function after($a, $b) @@ -4400,6 +4471,8 @@ class InternalDoc extends APIFactory * @param ?\Generator|Promise $actual Promise to resolve instead of $promise * @param string $file File * + * @psalm-suppress InvalidScope + * * @return Promise|mixed */ public function callFork($promise, $actual = null, $file = '') @@ -4733,7 +4806,7 @@ class InternalDoc extends APIFactory * @param integer $operation Locking mode * @param float $polling Polling interval * - * @return Promise + * @return Promise */ public function flock(string $file, int $operation, float $polling = 0.1) { @@ -4757,9 +4830,9 @@ class InternalDoc extends APIFactory * * @return \Generator */ - public function fullChatLastUpdated($id): \Generator + public function fullChatLastUpdated($id, array $extra = []) { - return yield from $this->API->fullChatLastUpdated($id); + return $this->__call(__FUNCTION__, [$id, $extra]); } /** * Get info about the logged-in user, not cached. @@ -5115,6 +5188,11 @@ class InternalDoc extends APIFactory { return $this->__call(__FUNCTION__, [$extra]); } + + public function getSessionId(\danog\MadelineProto\MTProto $madelineProto): string + { + return \danog\MadelineProto\MTProto::getSessionId($madelineProto); + } /** * Return current settings array. * @@ -5139,6 +5217,8 @@ class InternalDoc extends APIFactory * @param object $obj Object * @param string $var Attribute name * + * @psalm-suppress InvalidScope + * * @return mixed * @access public */ @@ -5215,6 +5295,11 @@ class InternalDoc extends APIFactory { return \danog\MadelineProto\Tools::inflateStripped($stripped); } + + public function initDb(\danog\MadelineProto\MTProto $MadelineProto, bool $reset = false, array $extra = []) + { + return $this->__call(__FUNCTION__, [$MadelineProto, $reset, $extra]); + } /** * Whether this is altervista. * @@ -5293,11 +5378,11 @@ class InternalDoc extends APIFactory * * @param string $hwat String to escape * - * @return void + * @return string */ public function markdownEscape(string $hwat): string { - return \danog\MadelineProto\Tools::markdownEscape($hwat); + return \danog\MadelineProto\StrTools::markdownEscape($hwat); } /** * Telegram UTF-8 multibyte split. @@ -5369,6 +5454,17 @@ class InternalDoc extends APIFactory { return $this->__call(__FUNCTION__, [$method, $args, $aargs, $extra]); } + /** + * Escape method name. + * + * @param string $method Method name + * + * @return string + */ + public function methodEscape(string $method): string + { + return \danog\MadelineProto\StrTools::methodEscape($method); + } /** * Convert double to binary version. * @@ -5476,7 +5572,7 @@ class InternalDoc extends APIFactory * * @param string $prompt Prompt * - * @return Promise + * @return Promise */ public function readLine(string $prompt = '') { @@ -5561,6 +5657,8 @@ class InternalDoc extends APIFactory * @param \Throwable $e Exception * @param string $file File where the strand started * + * @psalm-suppress InvalidScope + * * @return void */ public function rethrow(\Throwable $e, $file = ''): void @@ -5649,6 +5747,8 @@ class InternalDoc extends APIFactory * @param string $var Attribute name * @param mixed $val Attribute value * + * @psalm-suppress InvalidScope + * * @return mixed * @access public */ @@ -5784,7 +5884,7 @@ class InternalDoc extends APIFactory */ public function toCamelCase(string $input): string { - return \danog\MadelineProto\Tools::toCamelCase($input); + return \danog\MadelineProto\StrTools::toCamelCase($input); } /** * Convert to snake_case. @@ -5795,7 +5895,7 @@ class InternalDoc extends APIFactory */ public function toSnakeCase(string $input): string { - return \danog\MadelineProto\Tools::toSnakeCase($input); + return \danog\MadelineProto\StrTools::toSnakeCase($input); } /** * Convert MTProto channel ID to bot API channel ID. @@ -5808,6 +5908,17 @@ class InternalDoc extends APIFactory { return $this->__call(__FUNCTION__, [$id]); } + /** + * Escape type name. + * + * @param string $type String to escape + * + * @return string + */ + public function typeEscape(string $type): string + { + return \danog\MadelineProto\StrTools::typeEscape($type); + } /** * Unpack binary double. * diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index aeb69538..9eec3e06 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -32,8 +32,8 @@ use danog\MadelineProto\Loop\Generic\PeriodicLoop; use danog\MadelineProto\Loop\Update\FeedLoop; use danog\MadelineProto\Loop\Update\SeqLoop; use danog\MadelineProto\Loop\Update\UpdateLoop; -use danog\MadelineProto\MTProtoTools\GarbageCollector; use danog\MadelineProto\MTProtoTools\CombinedUpdatesState; +use danog\MadelineProto\MTProtoTools\GarbageCollector; use danog\MadelineProto\MTProtoTools\MinDatabase; use danog\MadelineProto\MTProtoTools\ReferenceDatabase; use danog\MadelineProto\MTProtoTools\UpdatesState; @@ -91,7 +91,7 @@ class MTProto extends AsyncConstruct implements TLCallback * * @var int */ - const V = 139; + const V = 141; /** * String release version. * @@ -128,12 +128,6 @@ class MTProto extends AsyncConstruct implements TLCallback * @var int */ const LOGGED_IN = 3; - /** - * Disallowed methods. - * - * @var array - */ - const DISALLOWED_METHODS = ['account.updatePasswordSettings' => 'You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info)', 'account.getPasswordSettings' => 'You cannot use this method directly; use $MadelineProto->update2fa($params), instead (see https://docs.madelineproto.xyz for more info)', '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 complete2falogin 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. * @@ -289,7 +283,7 @@ class MTProto extends AsyncConstruct implements TLCallback public $chats; /** - * Cache of usernames for chats + * Cache of usernames for chats. * * @var DbArray|Promise[] */ @@ -422,7 +416,7 @@ class MTProto extends AsyncConstruct implements TLCallback private $TL; /** - * List of properties stored in database (memory or external) + * List of properties stored in database (memory or external). * @see DbPropertiesFabric * @var array */ @@ -781,7 +775,6 @@ class MTProto extends AsyncConstruct implements TLCallback } yield from $this->initDb($this); - } /** @@ -1226,18 +1219,17 @@ class MTProto extends AsyncConstruct implements TLCallback 'lang_pack' => $lang_pack, ], 'tl_schema' => [ // TL scheme files - 'layer' => 112, + 'layer' => 113, // layer version 'src' => [ - 'mtproto' => __DIR__.'/../../../schemas/TL_mtproto_v1.tl', // mtproto TL scheme - 'telegram' => __DIR__.'/../../../schemas/TL_telegram_v112.tl', + 'mtproto' => __DIR__.'/TL_mtproto_v1.tl', // telegram TL scheme - 'secret' => __DIR__.'/../../../schemas/TL_secret.tl', + 'telegram' => __DIR__.'/TL_telegram_v113.tl', // secret chats TL scheme - 'calls' => __DIR__.'/../../../schemas/TL_calls.tl', - // calls TL scheme - 'botAPI' => __DIR__.'/../../../schemas/TL_botAPI.tl', + 'secret' => __DIR__.'/schemas/TL_secret.tl', + // bot API TL scheme + 'botAPI' => __DIR__.'/schemas/TL_botAPI.tl', ], ], 'logger' => [ // Logger settings @@ -1289,7 +1281,7 @@ class MTProto extends AsyncConstruct implements TLCallback /** * Where internal database will be stored? * memory - session file - * mysql - mysql database + * mysql - mysql database. */ 'db' => [ 'type' => 'memory', @@ -1531,7 +1523,7 @@ class MTProto extends AsyncConstruct implements TLCallback $this->updates = []; $this->secret_chats = []; - yield from $this->initDb($this,true); + yield from $this->initDb($this, true); $this->tos = ['expires' => 0, 'accepted' => true]; $this->referenceDatabase = new ReferenceDatabase($this); diff --git a/src/danog/MadelineProto/MTProtoTools/GarbageCollector.php b/src/danog/MadelineProto/MTProtoTools/GarbageCollector.php index 55ee2a4d..1f3463ed 100644 --- a/src/danog/MadelineProto/MTProtoTools/GarbageCollector.php +++ b/src/danog/MadelineProto/MTProtoTools/GarbageCollector.php @@ -7,53 +7,53 @@ use danog\MadelineProto\Logger; class GarbageCollector { - /** - * Ensure only one instance of GarbageCollector - * when multiple instances of MadelineProto running. - * @var bool - */ - public static bool $lock = false; + /** + * Ensure only one instance of GarbageCollector + * when multiple instances of MadelineProto running. + * @var bool + */ + public static bool $lock = false; - /** - * How often will check memory - * @var int - */ - public static int $checkIntervalMs = 1000; + /** + * How often will check memory. + * @var int + */ + public static int $checkIntervalMs = 1000; - /** - * Next cleanup will be triggered when memory consumption will increase by this amount - * @var int - */ - public static int $memoryDiffMb = 1; + /** + * Next cleanup will be triggered when memory consumption will increase by this amount. + * @var int + */ + public static int $memoryDiffMb = 1; - /** - * Memory consumption after last cleanup - * @var int - */ - private static int $memoryConsumption = 0; + /** + * Memory consumption after last cleanup. + * @var int + */ + private static int $memoryConsumption = 0; - public static function start(): void - { - if (static::$lock) { - return; - } - static::$lock = true; + public static function start(): void + { + if (static::$lock) { + return; + } + static::$lock = true; - Loop::repeat(static::$checkIntervalMs, static function() { - $currentMemory = static::getMemoryConsumption(); - if ($currentMemory > static::$memoryConsumption + static::$memoryDiffMb) { - gc_collect_cycles(); - static::$memoryConsumption = static::getMemoryConsumption(); - $cleanedMemory = $currentMemory - static::$memoryConsumption; - Logger::log("gc_collect_cycles done. Cleaned memory: $cleanedMemory Mb", Logger::NOTICE); - } - }); - } + Loop::repeat(static::$checkIntervalMs, static function () { + $currentMemory = static::getMemoryConsumption(); + if ($currentMemory > static::$memoryConsumption + static::$memoryDiffMb) { + \gc_collect_cycles(); + static::$memoryConsumption = static::getMemoryConsumption(); + $cleanedMemory = $currentMemory - static::$memoryConsumption; + Logger::log("gc_collect_cycles done. Cleaned memory: $cleanedMemory Mb", Logger::NOTICE); + } + }); + } - private static function getMemoryConsumption(): int - { - $memory = round(memory_get_usage()/1024/1024, 1); - Logger::log("Memory consumption: $memory Mb", Logger::VERBOSE); - return (int) $memory; - } -} \ No newline at end of file + private static function getMemoryConsumption(): int + { + $memory = \round(\memory_get_usage()/1024/1024, 1); + Logger::log("Memory consumption: $memory Mb", Logger::VERBOSE); + return (int) $memory; + } +} diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index 461c67d4..9ecbec28 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -208,7 +208,7 @@ trait PeerHandler private function cacheChatUsername(int $id, array $chat) { if ($id && !empty($chat['username'])) { - $this->usernames[strtolower($chat['username'])] = $id; + $this->usernames[\strtolower($chat['username'])] = $id; } } diff --git a/src/danog/MadelineProto/RPCErrorException.php b/src/danog/MadelineProto/RPCErrorException.php index dd660e15..6d4eb228 100644 --- a/src/danog/MadelineProto/RPCErrorException.php +++ b/src/danog/MadelineProto/RPCErrorException.php @@ -23,7 +23,7 @@ class RPCErrorException extends \Exception { use TL\PrettyException; /** - * RPC error code + * RPC error code. */ public string $rpc = ''; private $fetched = false; diff --git a/src/danog/MadelineProto/StrTools.php b/src/danog/MadelineProto/StrTools.php new file mode 100644 index 00000000..c3fc7448 --- /dev/null +++ b/src/danog/MadelineProto/StrTools.php @@ -0,0 +1,88 @@ +. + * + * @author Daniil Gentili + * @copyright 2016-2020 Daniil Gentili + * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 + * + * @link https://docs.madelineproto.xyz MadelineProto documentation + */ + +namespace danog\MadelineProto; + +/** + * Some tools. + */ +abstract class StrTools +{ + /** + * Convert to camelCase. + * + * @param string $input String + * + * @return string + */ + public static function toCamelCase(string $input): string + { + return \lcfirst(\str_replace('_', '', \ucwords($input, '_'))); + } + /** + * Convert to snake_case. + * + * @param string $input String + * + * @return string + */ + public static function toSnakeCase(string $input): string + { + \preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); + $ret = $matches[0]; + foreach ($ret as &$match) { + $match = $match == \strtoupper($match) ? \strtolower($match) : \lcfirst($match); + } + return \implode('_', $ret); + } + /** + * Escape string for markdown. + * + * @param string $hwat String to escape + * + * @return string + */ + public static function markdownEscape(string $hwat): string + { + return \str_replace('_', '\\_', $hwat); + } + /** + * Escape type name. + * + * @param string $type String to escape + * + * @return string + */ + public static function typeEscape(string $type): string + { + $type = \str_replace(['<', '>'], ['_of_', ''], $type); + return \preg_replace('/.*_of_/', '', $type); + } + /** + * Escape method name. + * + * @param string $method Method name + * + * @return string + */ + public static function methodEscape(string $method): string + { + return \str_replace('.', '->', $method); + } +} diff --git a/src/danog/MadelineProto/Stream/Common/BufferedRawStream.php b/src/danog/MadelineProto/Stream/Common/BufferedRawStream.php index 8ff699f2..cd769bfa 100644 --- a/src/danog/MadelineProto/Stream/Common/BufferedRawStream.php +++ b/src/danog/MadelineProto/Stream/Common/BufferedRawStream.php @@ -208,7 +208,7 @@ class BufferedRawStream implements BufferedStreamInterface, BufferInterface, Raw return $this->write($data); } /** - * Get remaining data from buffer + * Get remaining data from buffer. * * @return string */ @@ -217,8 +217,8 @@ class BufferedRawStream implements BufferedStreamInterface, BufferInterface, Raw $size = \fstat($this->memory_stream)['size']; $offset = \ftell($this->memory_stream); $buffer_length = $size - $offset; - $data = fread($this->memory_stream, $buffer_length); - fclose($this->memory_stream); + $data = \fread($this->memory_stream, $buffer_length); + \fclose($this->memory_stream); $this->memory_stream = null; return $data; } diff --git a/src/danog/MadelineProto/Stream/Common/UdpBufferedStream.php b/src/danog/MadelineProto/Stream/Common/UdpBufferedStream.php index da17267e..11de3357 100644 --- a/src/danog/MadelineProto/Stream/Common/UdpBufferedStream.php +++ b/src/danog/MadelineProto/Stream/Common/UdpBufferedStream.php @@ -30,7 +30,6 @@ use danog\MadelineProto\Stream\BufferedStreamInterface; use danog\MadelineProto\Stream\ConnectionContext; use danog\MadelineProto\Stream\RawStreamInterface; use danog\MadelineProto\Stream\ReadBufferInterface; -use danog\MadelineProto\Stream\StreamInterface; use danog\MadelineProto\Stream\Transport\DefaultStream; use danog\MadelineProto\Stream\WriteBufferInterface; @@ -135,7 +134,7 @@ class UdpBufferedStream extends DefaultStream implements BufferedStreamInterface private RawStreamInterface $stream; private string $data = ''; /** - * Constructor function + * Constructor function. * * @param integer $length * @param string $append @@ -172,7 +171,7 @@ class UdpBufferedStream extends DefaultStream implements BufferedStreamInterface throw new Exception('Tried to send too much out of frame data, cannot append'); } } - return new Success(strlen($data)); + return new Success(\strlen($data)); } }); } diff --git a/src/danog/MadelineProto/TL_botAPI.tl b/src/danog/MadelineProto/TL_botAPI.tl new file mode 100644 index 00000000..8c6dfdd0 --- /dev/null +++ b/src/danog/MadelineProto/TL_botAPI.tl @@ -0,0 +1,19 @@ +bot_thumbnail#0 dc_id:int id:long access_hash:long volume_id:long = File; +bot_profile_photo#1 dc_id:int id:long access_hash:long volume_id:long = File; +bot_photo#2 dc_id:int id:long access_hash:long volume_id:long = File; + +bot_voice#3 dc_id:int id:long access_hash:long = File; +bot_video#4 dc_id:int id:long access_hash:long = File; +bot_document#5 dc_id:int id:long access_hash:long = File; +bot_encrypted#6 dc_id:int id:long access_hash:long = File; +bot_temp#7 dc_id:int id:long access_hash:long = File; +bot_sticker#8 dc_id:int id:long access_hash:long = File; +bot_audio#9 dc_id:int id:long access_hash:long = File; +bot_gif#A dc_id:int id:long access_hash:long = File; +bot_encrypted_thumbnail#B dc_id:int id:long access_hash:long = File; +bot_wallpaper#C dc_id:int id:long access_hash:long = File; +bot_video_note#D dc_id:int id:long access_hash:long = File; +bot_secure_raw#F dc_id:int id:long access_hash:long = File; +bot_secure#10 dc_id:int id:long access_hash:long = File; +bot_background#11 dc_id:int id:long access_hash:long = File; +bot_size#12 dc_id:int id:long access_hash:long = File; diff --git a/src/danog/MadelineProto/TL_mtproto_v1.tl b/src/danog/MadelineProto/TL_mtproto_v1.tl new file mode 100644 index 00000000..16e7f39c --- /dev/null +++ b/src/danog/MadelineProto/TL_mtproto_v1.tl @@ -0,0 +1,86 @@ +resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector = ResPQ; + +vector {t:Type} # [ t ] = Vector t; + +p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data; +p_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data; + +p_q_inner_data pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data; +p_q_inner_data_temp pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data; + +server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params; +server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params; + +server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data; + +client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data; + +dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer; +dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer; +dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer; + +bind_auth_key_inner#75a3f765 nonce:long temp_auth_key_id:long perm_auth_key_id:long temp_session_id:long expires_at:int = BindAuthKeyInner; + +rpc_result#f35c6d01 req_msg_id:long result:Object = RpcResult; +rpc_error#2144ca19 error_code:int error_message:string = RpcError; + +rpc_answer_unknown#5e2ad36e = RpcDropAnswer; +rpc_answer_dropped_running#cd78e586 = RpcDropAnswer; +rpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer; + +future_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt; +future_salts#ae500895 req_msg_id:long now:int salts:vector = FutureSalts; + +pong#347773c5 msg_id:long ping_id:long = Pong; + +destroy_session_ok#e22045fc session_id:long = DestroySessionRes; +destroy_session_none#62d350c9 session_id:long = DestroySessionRes; + +new_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession; + +msg_container#73f1f8dc messages:vector<%Message> = MessageContainer; +message msg_id:long seqno:int bytes:int body:Object = Message; +msg_copy#e06046b2 orig_message:Message = MessageCopy; + +gzip_packed#3072cfa1 packed_data:bytes = Object; + +msgs_ack#62d6b459 msg_ids:Vector = MsgsAck; + +bad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification; +bad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification; + +msg_resend_ans_req#8610baeb msg_ids:Vector = MsgResendReq; +msg_resend_req#7d861a08 msg_ids:Vector = MsgResendReq; +msgs_state_req#da69fb52 msg_ids:Vector = MsgsStateReq; +msgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo; +msgs_all_info#8cc0d131 msg_ids:Vector info:string = MsgsAllInfo; +msg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo; +msg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo; + +rsa_public_key n:string e:string = RSAPublicKey; + +http_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait; + +---functions--- + +req_pq_multi#be7e8ef1 nonce:int128 = ResPQ; + +req_pq nonce:int128 = ResPQ; + +req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params; + +set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer; + +rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer; +get_future_salts#b921bd04 num:int = FutureSalts; +ping#7abe77ec ping_id:long = Pong; +ping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong; +destroy_session#e7512126 session_id:long = DestroySessionRes; + +//test.useGzipPacked = GzipPacked; +//test.useServerDhInnerData = Server_DH_inner_data; +//test.useNewSessionCreated = NewSession; +//test.useMsgsAck = MsgsAck; +//test.useBadMsgNotification = BadMsgNotification; + +//test.useOther key:rsa_public_key p_q_data:P_Q_inner_data dh_data:client_DH_inner_data = RpcError; diff --git a/src/danog/MadelineProto/TL_secret.tl b/src/danog/MadelineProto/TL_secret.tl new file mode 100644 index 00000000..3ff3f13d --- /dev/null +++ b/src/danog/MadelineProto/TL_secret.tl @@ -0,0 +1,76 @@ +===8=== +decryptedMessage#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage; +decryptedMessageService#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage; +decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia; +decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia; +decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia; +decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia; +decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia; +decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction; +decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia; +decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia; +decryptedMessageActionReadMessages#c4f40be random_ids:Vector = DecryptedMessageAction; +decryptedMessageActionDeleteMessages#65614304 random_ids:Vector = DecryptedMessageAction; +decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector = DecryptedMessageAction; +decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction; + +===17=== +decryptedMessage#204d3878 random_id:long ttl:int message:string media:DecryptedMessageMedia = DecryptedMessage; +decryptedMessageService#73164160 random_id:long action:DecryptedMessageAction = DecryptedMessage; +decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia; +decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia; +decryptedMessageLayer#1be31789 random_bytes:bytes layer:int in_seq_no:int out_seq_no:int message:DecryptedMessage = DecryptedMessageLayer; +sendMessageTypingAction#16bf744e = SendMessageAction; +sendMessageCancelAction#fd5ec8f5 = SendMessageAction; +sendMessageRecordVideoAction#a187d66f = SendMessageAction; +sendMessageUploadVideoAction#92042ff7 = SendMessageAction; +sendMessageRecordAudioAction#d52f73f7 = SendMessageAction; +sendMessageUploadAudioAction#e6ac8a6f = SendMessageAction; +sendMessageUploadPhotoAction#990a3c1a = SendMessageAction; +sendMessageUploadDocumentAction#8faee98e = SendMessageAction; +sendMessageGeoLocationAction#176f8ba1 = SendMessageAction; +sendMessageChooseContactAction#628cbc6f = SendMessageAction; +decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction; +decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction; +decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction; + +===20=== +decryptedMessageActionRequestKey#f3c9611b exchange_id:long g_a:bytes = DecryptedMessageAction; +decryptedMessageActionAcceptKey#6fe1735b exchange_id:long g_b:bytes key_fingerprint:long = DecryptedMessageAction; +decryptedMessageActionAbortKey#dd05ec6b exchange_id:long = DecryptedMessageAction; +decryptedMessageActionCommitKey#ec2e0b9b exchange_id:long key_fingerprint:long = DecryptedMessageAction; +decryptedMessageActionNoop#a82fdd63 = DecryptedMessageAction; + +===23=== +documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute; +documentAttributeAnimated#11b58939 = DocumentAttribute; +documentAttributeSticker#fb0a5727 = DocumentAttribute; +documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute; +documentAttributeAudio#51448e5 duration:int = DocumentAttribute; +documentAttributeFilename#15590068 file_name:string = DocumentAttribute; +photoSizeEmpty#e17e23c type:string = PhotoSize; +photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize; +photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize; +fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation; +fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation; +decryptedMessageMediaExternalDocument#fa95b0dd id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector = DecryptedMessageMedia; + +===45=== +decryptedMessage#36b091de flags:# random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector via_bot_name:flags.11?string reply_to_random_id:flags.3?long = DecryptedMessage; +decryptedMessageMediaPhoto#f1fa8d78 thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia; +decryptedMessageMediaVideo#970c8c0e thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes caption:string = DecryptedMessageMedia; +decryptedMessageMediaDocument#7afe8ae2 thumb:bytes thumb_w:int thumb_h:int mime_type:string size:int key:bytes iv:bytes attributes:Vector caption:string = DecryptedMessageMedia; + +===46=== +decryptedMessageMediaVenue#8a0df56f lat:double long:double title:string address:string provider:string venue_id:string = DecryptedMessageMedia; +documentAttributeAudio#ded218e0 duration:int title:string performer:string = DocumentAttribute; +decryptedMessageMediaWebPage#e50511d8 url:string = DecryptedMessageMedia; + +===55=== +documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute; + +===66=== +documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true duration:int w:int h:int = DocumentAttribute; + +===73=== +decryptedMessage#91cc4674 flags:# random_id:long ttl:int message:string media:flags.9?DecryptedMessageMedia entities:flags.7?Vector via_bot_name:flags.11?string reply_to_random_id:flags.3?long grouped_id:flags.17?long = DecryptedMessage; diff --git a/src/danog/MadelineProto/TL_telegram_v113.tl b/src/danog/MadelineProto/TL_telegram_v113.tl new file mode 100644 index 00000000..03a6bdb3 --- /dev/null +++ b/src/danog/MadelineProto/TL_telegram_v113.tl @@ -0,0 +1,1469 @@ +boolFalse#bc799737 = Bool; +boolTrue#997275b5 = Bool; + +true#3fedd339 = True; + +vector#1cb5c415 {t:Type} # [ t ] = Vector t; + +error#c4b9f9bb code:int text:string = Error; + +null#56730bcc = Null; + +inputPeerEmpty#7f3b18ea = InputPeer; +inputPeerSelf#7da07ec9 = InputPeer; +inputPeerChat#179be863 chat_id:int = InputPeer; +inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer; +inputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer; +inputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer; +inputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer; + +inputUserEmpty#b98886cf = InputUser; +inputUserSelf#f7c1b13f = InputUser; +inputUser#d8292816 user_id:int access_hash:long = InputUser; +inputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser; + +inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact; + +inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile; +inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile; + +inputMediaEmpty#9664f57f = InputMedia; +inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia; +inputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia; +inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia; +inputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia; +inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia; +inputMediaDocument#23ab23d2 flags:# id:InputDocument ttl_seconds:flags.0?int = InputMedia; +inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia; +inputMediaGifExternal#4843b0fd url:string q:string = InputMedia; +inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia; +inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia; +inputMediaGame#d33f43f3 id:InputGame = InputMedia; +inputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia; +inputMediaGeoLive#ce4e82fd flags:# stopped:flags.0?true geo_point:InputGeoPoint period:flags.1?int = InputMedia; +inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector solution:flags.1?string solution_entities:flags.1?Vector = InputMedia; +inputMediaDice#e66fbf7b emoticon:string = InputMedia; + +inputChatPhotoEmpty#1ca48f57 = InputChatPhoto; +inputChatUploadedPhoto#927c55b4 file:InputFile = InputChatPhoto; +inputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto; + +inputGeoPointEmpty#e4c123d6 = InputGeoPoint; +inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint; + +inputPhotoEmpty#1cd7bf0d = InputPhoto; +inputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto; + +inputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation; +inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation; +inputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation; +inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation; +inputTakeoutFileLocation#29be5899 = InputFileLocation; +inputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation; +inputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation; +inputPeerPhotoFileLocation#27d69997 flags:# big:flags.0?true peer:InputPeer volume_id:long local_id:int = InputFileLocation; +inputStickerSetThumb#dbaeae9 stickerset:InputStickerSet volume_id:long local_id:int = InputFileLocation; + +peerUser#9db1bc6d user_id:int = Peer; +peerChat#bad0e5bb chat_id:int = Peer; +peerChannel#bddde532 channel_id:int = Peer; + +storage.fileUnknown#aa963b05 = storage.FileType; +storage.filePartial#40bc6f52 = storage.FileType; +storage.fileJpeg#7efe0e = storage.FileType; +storage.fileGif#cae1aadf = storage.FileType; +storage.filePng#a4f63c0 = storage.FileType; +storage.filePdf#ae1e508d = storage.FileType; +storage.fileMp3#528a0677 = storage.FileType; +storage.fileMov#4b09ebbc = storage.FileType; +storage.fileMp4#b3cea0e4 = storage.FileType; +storage.fileWebp#1081464c = storage.FileType; + +userEmpty#200250ba id:int = User; +user#938458c1 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User; + +userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; +userProfilePhoto#ecd75d8c photo_id:long photo_small:FileLocation photo_big:FileLocation dc_id:int = UserProfilePhoto; + +userStatusEmpty#9d05049 = UserStatus; +userStatusOnline#edb93949 expires:int = UserStatus; +userStatusOffline#8c703f was_online:int = UserStatus; +userStatusRecently#e26f42f1 = UserStatus; +userStatusLastWeek#7bf09fc = UserStatus; +userStatusLastMonth#77ebc742 = UserStatus; + +chatEmpty#9ba2d800 id:int = Chat; +chat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat; +chatForbidden#7328bdb id:int title:string = Chat; +channel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat; +channelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat; + +chatFull#1b7c9db3 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int = ChatFull; +channelFull#f0e6672a flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_view_stats:flags.12?true can_set_location:flags.16?true has_scheduled:flags.19?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int = ChatFull; + +chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; +chatParticipantCreator#da13538a user_id:int = ChatParticipant; +chatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant; + +chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants; +chatParticipants#3f460fed chat_id:int participants:Vector version:int = ChatParticipants; + +chatPhotoEmpty#37c1011c = ChatPhoto; +chatPhoto#475cdbd5 photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto; + +messageEmpty#83e5de54 id:int = Message; +message#452c0e65 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector = Message; +messageService#9e19a1f6 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?int to_id:Peer reply_to_msg_id:flags.3?int date:int action:MessageAction = Message; + +messageMediaEmpty#3ded6320 = MessageMedia; +messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia; +messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia; +messageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia; +messageMediaUnsupported#9f84f49e = MessageMedia; +messageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia; +messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia; +messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia; +messageMediaGame#fdb19008 game:Game = MessageMedia; +messageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia; +messageMediaGeoLive#7c3c2609 geo:GeoPoint period:int = MessageMedia; +messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia; +messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia; + +messageActionEmpty#b6aef7b0 = MessageAction; +messageActionChatCreate#a6638b9a title:string users:Vector = MessageAction; +messageActionChatEditTitle#b5a1ce5a title:string = MessageAction; +messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction; +messageActionChatDeletePhoto#95e3fbef = MessageAction; +messageActionChatAddUser#488a7337 users:Vector = MessageAction; +messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction; +messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction; +messageActionChannelCreate#95d2ac92 title:string = MessageAction; +messageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction; +messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction; +messageActionPinMessage#94bd38ed = MessageAction; +messageActionHistoryClear#9fbab604 = MessageAction; +messageActionGameScore#92a72876 game_id:long score:int = MessageAction; +messageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction; +messageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction; +messageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction; +messageActionScreenshotTaken#4792929b = MessageAction; +messageActionCustomAction#fae69f56 message:string = MessageAction; +messageActionBotAllowed#abe9affe domain:string = MessageAction; +messageActionSecureValuesSentMe#1b287353 values:Vector credentials:SecureCredentialsEncrypted = MessageAction; +messageActionSecureValuesSent#d95c6154 types:Vector = MessageAction; +messageActionContactSignUp#f3f25f76 = MessageAction; + +dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog; +dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; + +photoEmpty#2331b22d id:long = Photo; +photo#d07504a5 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector dc_id:int = Photo; + +photoSizeEmpty#e17e23c type:string = PhotoSize; +photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize; +photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize; +photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize; + +geoPointEmpty#1117dd5f = GeoPoint; +geoPoint#296f104 long:double lat:double access_hash:long = GeoPoint; + +auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode; + +auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization; +auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization; + +auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization; + +inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer; +inputNotifyUsers#193b4417 = InputNotifyPeer; +inputNotifyChats#4a95e84e = InputNotifyPeer; +inputNotifyBroadcasts#b1db7c7e = InputNotifyPeer; + +inputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = InputPeerNotifySettings; + +peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings; + +peerSettings#818426cd flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true = PeerSettings; + +wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper; +wallPaperNoFile#8af40b25 flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper; + +inputReportReasonSpam#58dbcab8 = ReportReason; +inputReportReasonViolence#1e22c78d = ReportReason; +inputReportReasonPornography#2e59d922 = ReportReason; +inputReportReasonChildAbuse#adf44ee3 = ReportReason; +inputReportReasonOther#e1746d0a text:string = ReportReason; +inputReportReasonCopyright#9b89f93a = ReportReason; +inputReportReasonGeoIrrelevant#dbd4feed = ReportReason; + +userFull#edf17c12 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int = UserFull; + +contact#f911c994 user_id:int mutual:Bool = Contact; + +importedContact#d0028438 user_id:int client_id:long = ImportedContact; + +contactBlocked#561bc879 user_id:int date:int = ContactBlocked; + +contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus; + +contacts.contactsNotModified#b74ba9d2 = contacts.Contacts; +contacts.contacts#eae87e42 contacts:Vector saved_count:int users:Vector = contacts.Contacts; + +contacts.importedContacts#77d01c3b imported:Vector popular_invites:Vector retry_contacts:Vector users:Vector = contacts.ImportedContacts; + +contacts.blocked#1c138d15 blocked:Vector users:Vector = contacts.Blocked; +contacts.blockedSlice#900802a1 count:int blocked:Vector users:Vector = contacts.Blocked; + +messages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs; +messages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs; +messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs; + +messages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages; +messages.messagesSlice#c8edce1e flags:# inexact:flags.1?true count:int next_rate:flags.0?int messages:Vector chats:Vector users:Vector = messages.Messages; +messages.channelMessages#99262e37 flags:# inexact:flags.1?true pts:int count:int messages:Vector chats:Vector users:Vector = messages.Messages; +messages.messagesNotModified#74535f21 count:int = messages.Messages; + +messages.chats#64ff9fd5 chats:Vector = messages.Chats; +messages.chatsSlice#9cd81144 count:int chats:Vector = messages.Chats; + +messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull; + +messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory; + +inputMessagesFilterEmpty#57e2f66c = MessagesFilter; +inputMessagesFilterPhotos#9609a51c = MessagesFilter; +inputMessagesFilterVideo#9fc00e65 = MessagesFilter; +inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter; +inputMessagesFilterDocument#9eddf188 = MessagesFilter; +inputMessagesFilterUrl#7ef0dd87 = MessagesFilter; +inputMessagesFilterGif#ffc86587 = MessagesFilter; +inputMessagesFilterVoice#50f5c392 = MessagesFilter; +inputMessagesFilterMusic#3751b49e = MessagesFilter; +inputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter; +inputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter; +inputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter; +inputMessagesFilterRoundVideo#b549da53 = MessagesFilter; +inputMessagesFilterMyMentions#c1f8e69a = MessagesFilter; +inputMessagesFilterGeo#e7026d0d = MessagesFilter; +inputMessagesFilterContacts#e062db83 = MessagesFilter; + +updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update; +updateMessageID#4e90bfd6 id:int random_id:long = Update; +updateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update; +updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update; +updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update; +updateChatParticipants#7761198 participants:ChatParticipants = Update; +updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update; +updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update; +updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update; +updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; +updateEncryptedChatTyping#1710f156 chat_id:int = Update; +updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update; +updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update; +updateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update; +updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update; +updateDcOptions#8e5e9873 dc_options:Vector = Update; +updateUserBlocked#80ece81a user_id:int blocked:Bool = Update; +updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update; +updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update; +updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; +updateUserPhone#12b9417b user_id:int phone:string = Update; +updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update; +updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; +updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update; +updateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update; +updateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update; +updateChannel#b6d45656 channel_id:int = Update; +updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update; +updateReadChannelInbox#330b5424 flags:# folder_id:flags.0?int channel_id:int max_id:int still_unread_count:int pts:int = Update; +updateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector pts:int pts_count:int = Update; +updateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update; +updateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update; +updateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update; +updateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector = Update; +updateStickerSets#43ae3dec = Update; +updateSavedGifs#9375341e = Update; +updateBotInlineQuery#54826690 flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint offset:string = Update; +updateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update; +updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update; +updateChannelPinnedMessage#98592475 channel_id:int id:int = Update; +updateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; +updateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update; +updateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; +updateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update; +updateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update; +updateReadFeaturedStickers#571d2742 = Update; +updateRecentStickers#9a422c20 = Update; +updateConfig#a229dd06 = Update; +updatePtsChanged#3354678f = Update; +updateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update; +updateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update; +updatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector = Update; +updateBotWebhookJSON#8317c0c3 data:DataJSON = Update; +updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update; +updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update; +updateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update; +updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update; +updateLangPackTooLong#46560264 lang_code:string = Update; +updateLangPack#56022f4d difference:LangPackDifference = Update; +updateFavedStickers#e511996d = Update; +updateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector = Update; +updateContactsReset#7084a7be = Update; +updateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update; +updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update; +updateUserPinnedMessage#4c43da18 user_id:int id:int = Update; +updateChatPinnedMessage#e10db349 chat_id:int id:int version:int = Update; +updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update; +updateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update; +updateFolderPeers#19360dc0 folder_peers:Vector pts:int pts_count:int = Update; +updatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update; +updatePeerLocated#b4afcfb0 peers:Vector = Update; +updateNewScheduledMessage#39a51dfb message:Message = Update; +updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector = Update; +updateTheme#8216fba3 theme:Theme = Update; +updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update; +updateLoginToken#564fe691 = Update; +updateMessagePollVote#42f88f2c poll_id:long user_id:int options:Vector = Update; +updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update; +updateDialogFilterOrder#a5d72105 order:Vector = Update; +updateDialogFilters#3504914f = Update; + +updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; + +updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference; +updates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector state:updates.State = updates.Difference; +updates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector intermediate_state:updates.State = updates.Difference; +updates.differenceTooLong#4afe8f6d pts:int = updates.Difference; + +updatesTooLong#e317af7e = Updates; +updateShortMessage#914fbf11 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; +updateShortChatMessage#16812688 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; +updateShort#78d4dec1 update:Update date:int = Updates; +updatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates; +updates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates; +updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector = Updates; + +photos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos; +photos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos; + +photos.photo#20212ca8 photo:Photo users:Vector = photos.Photo; + +upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File; +upload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector = upload.File; + +dcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption; + +config#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config; + +nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc; + +help.appUpdate#1da7158f flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector document:flags.1?Document url:flags.2?string = help.AppUpdate; +help.noAppUpdate#c45a6536 = help.AppUpdate; + +help.inviteText#18cb9f78 message:string = help.InviteText; + +encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat; +encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat; +encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat; +encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat; +encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat; + +inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat; + +encryptedFileEmpty#c21f497e = EncryptedFile; +encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile; + +inputEncryptedFileEmpty#1837c364 = InputEncryptedFile; +inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile; +inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile; +inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile; + +encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage; +encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage; + +messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig; +messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig; + +messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage; +messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage; + +inputDocumentEmpty#72f0eaae = InputDocument; +inputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument; + +documentEmpty#36f8c871 id:long = Document; +document#9ba29cc1 flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector dc_id:int attributes:Vector = Document; + +help.support#17c6b5f6 phone_number:string user:User = help.Support; + +notifyPeer#9fd40bd8 peer:Peer = NotifyPeer; +notifyUsers#b4c83b4c = NotifyPeer; +notifyChats#c007cec3 = NotifyPeer; +notifyBroadcasts#d612e8ef = NotifyPeer; + +sendMessageTypingAction#16bf744e = SendMessageAction; +sendMessageCancelAction#fd5ec8f5 = SendMessageAction; +sendMessageRecordVideoAction#a187d66f = SendMessageAction; +sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction; +sendMessageRecordAudioAction#d52f73f7 = SendMessageAction; +sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction; +sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction; +sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction; +sendMessageGeoLocationAction#176f8ba1 = SendMessageAction; +sendMessageChooseContactAction#628cbc6f = SendMessageAction; +sendMessageGamePlayAction#dd6a8f48 = SendMessageAction; +sendMessageRecordRoundAction#88f27fbc = SendMessageAction; +sendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction; + +contacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found; + +inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey; +inputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey; +inputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey; +inputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey; +inputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey; +inputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey; +inputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey; +inputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey; + +privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey; +privacyKeyChatInvite#500e6dfa = PrivacyKey; +privacyKeyPhoneCall#3d662b7b = PrivacyKey; +privacyKeyPhoneP2P#39491cc8 = PrivacyKey; +privacyKeyForwards#69ec56a3 = PrivacyKey; +privacyKeyProfilePhoto#96151fed = PrivacyKey; +privacyKeyPhoneNumber#d19ae46d = PrivacyKey; +privacyKeyAddedByPhone#42ffd42b = PrivacyKey; + +inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule; +inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule; +inputPrivacyValueAllowUsers#131cc67f users:Vector = InputPrivacyRule; +inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule; +inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule; +inputPrivacyValueDisallowUsers#90110467 users:Vector = InputPrivacyRule; +inputPrivacyValueAllowChatParticipants#4c81c1ba chats:Vector = InputPrivacyRule; +inputPrivacyValueDisallowChatParticipants#d82363af chats:Vector = InputPrivacyRule; + +privacyValueAllowContacts#fffe1bac = PrivacyRule; +privacyValueAllowAll#65427b82 = PrivacyRule; +privacyValueAllowUsers#4d5bbe0c users:Vector = PrivacyRule; +privacyValueDisallowContacts#f888fa1a = PrivacyRule; +privacyValueDisallowAll#8b73e763 = PrivacyRule; +privacyValueDisallowUsers#c7f49b7 users:Vector = PrivacyRule; +privacyValueAllowChatParticipants#18be796b chats:Vector = PrivacyRule; +privacyValueDisallowChatParticipants#acae0690 chats:Vector = PrivacyRule; + +account.privacyRules#50a04e45 rules:Vector chats:Vector users:Vector = account.PrivacyRules; + +accountDaysTTL#b8d0afdf days:int = AccountDaysTTL; + +documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute; +documentAttributeAnimated#11b58939 = DocumentAttribute; +documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute; +documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute; +documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute; +documentAttributeFilename#15590068 file_name:string = DocumentAttribute; +documentAttributeHasStickers#9801d2f7 = DocumentAttribute; + +messages.stickersNotModified#f1749a22 = messages.Stickers; +messages.stickers#e4599bbd hash:int stickers:Vector = messages.Stickers; + +stickerPack#12b299d4 emoticon:string documents:Vector = StickerPack; + +messages.allStickersNotModified#e86602c3 = messages.AllStickers; +messages.allStickers#edfd405f hash:int sets:Vector = messages.AllStickers; + +messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages; + +webPageEmpty#eb1477e8 id:long = WebPage; +webPagePending#c586da1c id:long date:int = WebPage; +webPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage; +webPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage; + +authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization; + +account.authorizations#1250abde authorizations:Vector = account.Authorizations; + +account.password#ad2641f8 flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes = account.Password; + +account.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings; + +account.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings; + +auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery; + +receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage; + +chatInviteEmpty#69df3769 = ExportedChatInvite; +chatInviteExported#fc2e05bc link:string = ExportedChatInvite; + +chatInviteAlready#5a686d7c chat:Chat = ChatInvite; +chatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector = ChatInvite; + +inputStickerSetEmpty#ffb62b95 = InputStickerSet; +inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet; +inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet; +inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet; +inputStickerSetDice#e67f520e emoticon:string = InputStickerSet; + +stickerSet#eeb46f27 flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumb:flags.4?PhotoSize thumb_dc_id:flags.4?int count:int hash:int = StickerSet; + +messages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet; + +botCommand#c27ac8c7 command:string description:string = BotCommand; + +botInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo; + +keyboardButton#a2fa4880 text:string = KeyboardButton; +keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton; +keyboardButtonCallback#683a5e46 text:string data:bytes = KeyboardButton; +keyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton; +keyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton; +keyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton; +keyboardButtonGame#50f41ccf text:string = KeyboardButton; +keyboardButtonBuy#afd93fbb text:string = KeyboardButton; +keyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton; +inputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton; +keyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton; + +keyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow; + +replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup; +replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup; +replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector = ReplyMarkup; +replyInlineMarkup#48a30254 rows:Vector = ReplyMarkup; + +messageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity; +messageEntityMention#fa04579d offset:int length:int = MessageEntity; +messageEntityHashtag#6f635b0d offset:int length:int = MessageEntity; +messageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity; +messageEntityUrl#6ed02538 offset:int length:int = MessageEntity; +messageEntityEmail#64e475c2 offset:int length:int = MessageEntity; +messageEntityBold#bd610bc9 offset:int length:int = MessageEntity; +messageEntityItalic#826f8b60 offset:int length:int = MessageEntity; +messageEntityCode#28a20571 offset:int length:int = MessageEntity; +messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity; +messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity; +messageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity; +inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity; +messageEntityPhone#9b69e34b offset:int length:int = MessageEntity; +messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity; +messageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity; +messageEntityStrike#bf0693d4 offset:int length:int = MessageEntity; +messageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity; +messageEntityBankCard#761e6af4 offset:int length:int = MessageEntity; + +inputChannelEmpty#ee8c1e86 = InputChannel; +inputChannel#afeb712e channel_id:int access_hash:long = InputChannel; +inputChannelFromMessage#2a286531 peer:InputPeer msg_id:int channel_id:int = InputChannel; + +contacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector users:Vector = contacts.ResolvedPeer; + +messageRange#ae30253 min_id:int max_id:int = MessageRange; + +updates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference; +updates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector chats:Vector users:Vector = updates.ChannelDifference; +updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector other_updates:Vector chats:Vector users:Vector = updates.ChannelDifference; + +channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter; +channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector = ChannelMessagesFilter; + +channelParticipant#15ebac1d user_id:int date:int = ChannelParticipant; +channelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant; +channelParticipantCreator#808d15a4 flags:# user_id:int rank:flags.0?string = ChannelParticipant; +channelParticipantAdmin#ccbebbaf flags:# can_edit:flags.0?true self:flags.1?true user_id:int inviter_id:flags.1?int promoted_by:int date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant; +channelParticipantBanned#1c0facaf flags:# left:flags.0?true user_id:int kicked_by:int date:int banned_rights:ChatBannedRights = ChannelParticipant; + +channelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter; +channelParticipantsAdmins#b4608969 = ChannelParticipantsFilter; +channelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter; +channelParticipantsBots#b0d1865b = ChannelParticipantsFilter; +channelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter; +channelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter; +channelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter; + +channels.channelParticipants#f56ee2a8 count:int participants:Vector users:Vector = channels.ChannelParticipants; +channels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants; + +channels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector = channels.ChannelParticipant; + +help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector min_age_confirm:flags.1?int = help.TermsOfService; + +foundGif#162ecc1f url:string thumb_url:string content_url:string content_type:string w:int h:int = FoundGif; +foundGifCached#9c750409 url:string photo:Photo document:Document = FoundGif; + +messages.foundGifs#450a1c0a next_offset:int results:Vector = messages.FoundGifs; + +messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs; +messages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs; + +inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageMediaGeo#c1b15d65 flags:# geo_point:InputGeoPoint period:int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; + +inputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult; +inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult; +inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult; +inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult; + +botInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageMediaGeo#b722de65 flags:# geo:GeoPoint period:int reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage; + +botInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult; +botInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult; + +messages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector cache_time:int users:Vector = messages.BotResults; + +exportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink; + +messageFwdHeader#353a686b flags:# from_id:flags.0?int from_name:flags.5?string date:int channel_id:flags.1?int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader; + +auth.codeTypeSms#72a3158c = auth.CodeType; +auth.codeTypeCall#741cd3e3 = auth.CodeType; +auth.codeTypeFlashCall#226ccefb = auth.CodeType; + +auth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType; +auth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType; +auth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType; +auth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType; + +messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer; + +messages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData; + +inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID; + +inlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM; + +messages.peerDialogs#3371c354 dialogs:Vector messages:Vector chats:Vector users:Vector state:updates.State = messages.PeerDialogs; + +topPeer#edcdc05b peer:Peer rating:double = TopPeer; + +topPeerCategoryBotsPM#ab661b5b = TopPeerCategory; +topPeerCategoryBotsInline#148677e2 = TopPeerCategory; +topPeerCategoryCorrespondents#637b7ed = TopPeerCategory; +topPeerCategoryGroups#bd17a14a = TopPeerCategory; +topPeerCategoryChannels#161d9628 = TopPeerCategory; +topPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory; +topPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory; +topPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory; + +topPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector = TopPeerCategoryPeers; + +contacts.topPeersNotModified#de266ef5 = contacts.TopPeers; +contacts.topPeers#70b772a8 categories:Vector chats:Vector users:Vector = contacts.TopPeers; +contacts.topPeersDisabled#b52c939d = contacts.TopPeers; + +draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage; +draftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector date:int = DraftMessage; + +messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers; +messages.featuredStickers#b6abc341 hash:int count:int sets:Vector unread:Vector = messages.FeaturedStickers; + +messages.recentStickersNotModified#b17f890 = messages.RecentStickers; +messages.recentStickers#22f3afb3 hash:int packs:Vector stickers:Vector dates:Vector = messages.RecentStickers; + +messages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers; + +messages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult; +messages.stickerSetInstallResultArchive#35e410a8 sets:Vector = messages.StickerSetInstallResult; + +stickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered; +stickerSetMultiCovered#3407e51b set:StickerSet covers:Vector = StickerSetCovered; + +maskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords; + +inputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia; +inputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia; + +game#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game; + +inputGameID#32c3e77 id:long access_hash:long = InputGame; +inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame; + +highScore#58fffcd0 pos:int user_id:int score:int = HighScore; + +messages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores; + +textEmpty#dc3d824f = RichText; +textPlain#744694e0 text:string = RichText; +textBold#6724abc4 text:RichText = RichText; +textItalic#d912a59c text:RichText = RichText; +textUnderline#c12622c4 text:RichText = RichText; +textStrike#9bf8bb95 text:RichText = RichText; +textFixed#6c3f19b9 text:RichText = RichText; +textUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText; +textEmail#de5a0dd6 text:RichText email:string = RichText; +textConcat#7e6260d7 texts:Vector = RichText; +textSubscript#ed6a8504 text:RichText = RichText; +textSuperscript#c7fb5e01 text:RichText = RichText; +textMarked#34b8621 text:RichText = RichText; +textPhone#1ccb966a text:RichText phone:string = RichText; +textImage#81ccf4f document_id:long w:int h:int = RichText; +textAnchor#35553762 text:RichText name:string = RichText; + +pageBlockUnsupported#13567e8a = PageBlock; +pageBlockTitle#70abc3fd text:RichText = PageBlock; +pageBlockSubtitle#8ffa9a1f text:RichText = PageBlock; +pageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock; +pageBlockHeader#bfd064ec text:RichText = PageBlock; +pageBlockSubheader#f12bb6e1 text:RichText = PageBlock; +pageBlockParagraph#467a0766 text:RichText = PageBlock; +pageBlockPreformatted#c070d93e text:RichText language:string = PageBlock; +pageBlockFooter#48870999 text:RichText = PageBlock; +pageBlockDivider#db20b188 = PageBlock; +pageBlockAnchor#ce0d37b0 name:string = PageBlock; +pageBlockList#e4e88011 items:Vector = PageBlock; +pageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock; +pageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock; +pageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock; +pageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock; +pageBlockCover#39f23300 cover:PageBlock = PageBlock; +pageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock; +pageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector caption:PageCaption = PageBlock; +pageBlockCollage#65a0fa4d items:Vector caption:PageCaption = PageBlock; +pageBlockSlideshow#31f9590 items:Vector caption:PageCaption = PageBlock; +pageBlockChannel#ef1751b5 channel:Chat = PageBlock; +pageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock; +pageBlockKicker#1e148390 text:RichText = PageBlock; +pageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector = PageBlock; +pageBlockOrderedList#9a8ae1e1 items:Vector = PageBlock; +pageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector title:RichText = PageBlock; +pageBlockRelatedArticles#16115a96 title:RichText articles:Vector = PageBlock; +pageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock; + +phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason; +phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason; +phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason; +phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason; + +dataJSON#7d748d04 data:string = DataJSON; + +labeledPrice#cb296bf8 label:string amount:long = LabeledPrice; + +invoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true currency:string prices:Vector = Invoice; + +paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge; + +postAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress; + +paymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo; + +paymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials; + +webDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector = WebDocument; +webDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector = WebDocument; + +inputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector = InputWebDocument; + +inputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation; +inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation; + +upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile; + +payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm; + +payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo; + +payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult; +payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult; + +payments.paymentReceipt#500911e1 flags:# date:int bot_id:int invoice:Invoice provider_id:int info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt; + +payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo; + +inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials; +inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials; +inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials; +inputPaymentCredentialsAndroidPay#ca05d50e payment_token:DataJSON google_transaction_id:string = InputPaymentCredentials; + +account.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword; + +shippingOption#b6213cdf id:string title:string prices:Vector = ShippingOption; + +inputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem; + +inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall; + +phoneCallEmpty#5366c915 id:long = PhoneCall; +phoneCallWaiting#1b8f4ad1 flags:# video:flags.5?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; +phoneCallRequested#87eabb53 flags:# video:flags.5?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCallAccepted#997c454a flags:# video:flags.5?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCall#8742ae7f flags:# p2p_allowed:flags.5?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall; +phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.5?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall; + +phoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection; + +phoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector = PhoneCallProtocol; + +phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector = phone.PhoneCall; + +upload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile; +upload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile; + +cdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey; + +cdnConfig#5725e40a public_keys:Vector = CdnConfig; + +langPackString#cad181f6 key:string value:string = LangPackString; +langPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString; +langPackStringDeleted#2979eeb2 key:string = LangPackString; + +langPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector = LangPackDifference; + +langPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage; + +channelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction; +channelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction; +channelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction; +channelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction; +channelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction; +channelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction; +channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction; +channelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction; +channelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction; + +channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent; + +channels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults; + +channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true = ChannelAdminLogEventsFilter; + +popularContact#5ce14175 client_id:long importers:int = PopularContact; + +messages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers; +messages.favedStickers#f37f2f16 hash:int packs:Vector stickers:Vector = messages.FavedStickers; + +recentMeUrlUnknown#46e1d13d url:string = RecentMeUrl; +recentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl; +recentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl; +recentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl; +recentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl; + +help.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vector = help.RecentMeUrls; + +inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia; + +webAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization; + +account.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations; + +inputMessageID#a676a322 id:int = InputMessage; +inputMessageReplyTo#bad88395 id:int = InputMessage; +inputMessagePinned#86872538 = InputMessage; + +inputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer; +inputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer; + +dialogPeer#e56dbf05 peer:Peer = DialogPeer; +dialogPeerFolder#514519e2 folder_id:int = DialogPeer; + +messages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets; +messages.foundStickerSets#5108d648 hash:int sets:Vector = messages.FoundStickerSets; + +fileHash#6242c773 offset:int limit:int hash:bytes = FileHash; + +inputClientProxy#75588b3f address:string port:int = InputClientProxy; + +help.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate; +help.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate; + +inputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile; +inputSecureFile#5367e5be id:long access_hash:long = InputSecureFile; + +secureFileEmpty#64199744 = SecureFile; +secureFile#e0277a62 id:long access_hash:long size:int dc_id:int date:int file_hash:bytes secret:bytes = SecureFile; + +secureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData; + +securePlainPhone#7d6099dd phone:string = SecurePlainData; +securePlainEmail#21ec5a5f email:string = SecurePlainData; + +secureValueTypePersonalDetails#9d2a81e3 = SecureValueType; +secureValueTypePassport#3dac6a00 = SecureValueType; +secureValueTypeDriverLicense#6e425c4 = SecureValueType; +secureValueTypeIdentityCard#a0d0744b = SecureValueType; +secureValueTypeInternalPassport#99a48f23 = SecureValueType; +secureValueTypeAddress#cbe31e26 = SecureValueType; +secureValueTypeUtilityBill#fc36954e = SecureValueType; +secureValueTypeBankStatement#89137c0d = SecureValueType; +secureValueTypeRentalAgreement#8b883488 = SecureValueType; +secureValueTypePassportRegistration#99e3806a = SecureValueType; +secureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType; +secureValueTypePhone#b320aadb = SecureValueType; +secureValueTypeEmail#8e3ca7ee = SecureValueType; + +secureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData hash:bytes = SecureValue; + +inputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData = InputSecureValue; + +secureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash; + +secureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError; +secureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError; +secureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError; +secureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError; +secureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError; +secureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector text:string = SecureValueError; +secureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError; +secureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError; +secureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector text:string = SecureValueError; + +secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted; + +account.authorizationForm#ad2e1cd8 flags:# required_types:Vector values:Vector errors:Vector users:Vector privacy_policy_url:flags.0?string = account.AuthorizationForm; + +account.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode; + +help.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo; +help.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector = help.DeepLinkInfo; + +savedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact; + +account.takeout#4dba4501 id:long = account.Takeout; + +passwordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo; +passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo; + +securePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo; +securePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo; +securePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo; + +secureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings; + +inputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP; +inputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP; + +secureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType; +secureRequiredTypeOneOf#27477b4 types:Vector = SecureRequiredType; + +help.passportConfigNotModified#bfb9f457 = help.PassportConfig; +help.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig; + +inputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent; + +jsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue; + +jsonNull#3f6d7b68 = JSONValue; +jsonBool#c7345e6a value:Bool = JSONValue; +jsonNumber#2be0dfa4 value:double = JSONValue; +jsonString#b71e767a value:string = JSONValue; +jsonArray#f7444763 value:Vector = JSONValue; +jsonObject#99c1d49d value:Vector = JSONValue; + +pageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell; + +pageTableRow#e0c0c5e5 cells:Vector = PageTableRow; + +pageCaption#6f747657 text:RichText credit:RichText = PageCaption; + +pageListItemText#b92fb6cd text:RichText = PageListItem; +pageListItemBlocks#25e073fc blocks:Vector = PageListItem; + +pageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem; +pageListOrderedItemBlocks#98dd8936 num:string blocks:Vector = PageListOrderedItem; + +pageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle; + +page#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector photos:Vector documents:Vector views:flags.3?int = Page; + +help.supportName#8c05f1c9 name:string = help.SupportName; + +help.userInfoEmpty#f3ae2eed = help.UserInfo; +help.userInfo#1eb3758 message:string entities:Vector author:string date:int = help.UserInfo; + +pollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer; + +poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector close_period:flags.4?int close_date:flags.5?int = Poll; + +pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters; + +pollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults; + +chatOnlines#f041e250 onlines:int = ChatOnlines; + +statsURL#47a971e0 url:string = StatsURL; + +chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true = ChatAdminRights; + +chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights; + +inputWallPaper#e630b979 id:long access_hash:long = InputWallPaper; +inputWallPaperSlug#72091c80 slug:string = InputWallPaper; +inputWallPaperNoFile#8427bbac = InputWallPaper; + +account.wallPapersNotModified#1c199183 = account.WallPapers; +account.wallPapers#702b65a9 hash:int wallpapers:Vector = account.WallPapers; + +codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings; + +wallPaperSettings#5086cf8 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings; + +autoDownloadSettings#e04232f3 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:int file_size_max:int video_upload_maxbitrate:int = AutoDownloadSettings; + +account.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings; + +emojiKeyword#d5b3b9f9 keyword:string emoticons:Vector = EmojiKeyword; +emojiKeywordDeleted#236df622 keyword:string emoticons:Vector = EmojiKeyword; + +emojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector = EmojiKeywordsDifference; + +emojiURL#a575739d url:string = EmojiURL; + +emojiLanguage#b3fb5361 lang_code:string = EmojiLanguage; + +fileLocationToBeDeprecated#bc7fc6cd volume_id:long local_id:int = FileLocation; + +folder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder; + +inputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer; + +folderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer; + +messages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter; + +urlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult; +urlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult; +urlAuthResultDefault#a9d6db1f = UrlAuthResult; + +channelLocationEmpty#bfb5ad8b = ChannelLocation; +channelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation; + +peerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated; +peerSelfLocated#f8ec284b expires:int = PeerLocated; + +restrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason; + +inputTheme#3c5693e9 id:long access_hash:long = InputTheme; +inputThemeSlug#f5890df1 slug:string = InputTheme; + +theme#28f1114 flags:# creator:flags.0?true default:flags.1?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:int = Theme; + +account.themesNotModified#f41eb622 = account.Themes; +account.themes#7f676421 hash:int themes:Vector = account.Themes; + +auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken; +auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken; +auth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken; + +account.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings; + +messages.inactiveChats#a927fec5 dates:Vector chats:Vector users:Vector = messages.InactiveChats; + +baseThemeClassic#c3a12462 = BaseTheme; +baseThemeDay#fbd81688 = BaseTheme; +baseThemeNight#b7b31ea8 = BaseTheme; +baseThemeTinted#6d5f77ee = BaseTheme; +baseThemeArctic#5b11125a = BaseTheme; + +inputThemeSettings#bd507cd1 flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings; + +themeSettings#9c14984a flags:# base_theme:BaseTheme accent_color:int message_top_color:flags.0?int message_bottom_color:flags.0?int wallpaper:flags.1?WallPaper = ThemeSettings; + +webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector settings:flags.1?ThemeSettings = WebPageAttribute; + +messageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote; +messageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote; +messageUserVoteMultiple#e8fe0de user_id:int options:Vector date:int = MessageUserVote; + +messages.votesList#823f649 flags:# count:int votes:Vector users:Vector next_offset:flags.0?string = messages.VotesList; + +bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl; + +payments.bankCardData#3e24e573 title:string open_urls:Vector = payments.BankCardData; + +dialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter; + +dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested; + +statsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays; + +statsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev; + +statsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue; + +statsGraphAsync#4a27eb2d token:string = StatsGraph; +statsGraphError#bedc9822 error:string = StatsGraph; +statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph; + +messageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters; + +stats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector = stats.BroadcastStats; + +help.promoDataEmpty#98f6ac75 expires:int = help.PromoData; +help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData; + +---functions--- + +invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; +invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector query:!X = X; +initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X; +invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X; +invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X; +invokeWithMessagesRange#365275f2 {X:Type} range:MessageRange query:!X = X; +invokeWithTakeout#aca9fd2e {X:Type} takeout_id:long query:!X = X; + +auth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode; +auth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization; +auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization; +auth.logOut#5717da40 = Bool; +auth.resetAuthorizations#9fab0d1a = Bool; +auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization; +auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization; +auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool; +auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization; +auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization; +auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery; +auth.recoverPassword#4ea56e92 code:string = auth.Authorization; +auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode; +auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool; +auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool; +auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector = auth.LoginToken; +auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken; +auth.acceptLoginToken#e894ad4d token:bytes = Authorization; + +account.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool; +account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector = Bool; +account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool; +account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings; +account.resetNotifySettings#db7e1747 = Bool; +account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User; +account.updateStatus#6628562c offline:Bool = Bool; +account.getWallPapers#aabb1763 hash:int = account.WallPapers; +account.reportPeer#ae189d5f peer:InputPeer reason:ReportReason = Bool; +account.checkUsername#2714d86c username:string = Bool; +account.updateUsername#3e0bdd7c username:string = User; +account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules; +account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.PrivacyRules; +account.deleteAccount#418d4e0b reason:string = Bool; +account.getAccountTTL#8fc711d = AccountDaysTTL; +account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool; +account.sendChangePhoneCode#82574ae5 phone_number:string settings:CodeSettings = auth.SentCode; +account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User; +account.updateDeviceLocked#38df3532 period:int = Bool; +account.getAuthorizations#e320c158 = account.Authorizations; +account.resetAuthorization#df77f3bc hash:long = Bool; +account.getPassword#548a30f5 = account.Password; +account.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings; +account.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool; +account.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode; +account.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool; +account.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword; +account.getWebAuthorizations#182e6d6f = account.WebAuthorizations; +account.resetWebAuthorization#2d01b9ef hash:long = Bool; +account.resetWebAuthorizations#682d2594 = Bool; +account.getAllSecureValues#b288bc7d = Vector; +account.getSecureValue#73665bc2 types:Vector = Vector; +account.saveSecureValue#899fe31d value:InputSecureValue secure_secret_id:long = SecureValue; +account.deleteSecureValue#b880bc4b types:Vector = Bool; +account.getAuthorizationForm#b86ba8e1 bot_id:int scope:string public_key:string = account.AuthorizationForm; +account.acceptAuthorization#e7027c94 bot_id:int scope:string public_key:string value_hashes:Vector credentials:SecureCredentialsEncrypted = Bool; +account.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode; +account.verifyPhone#4dd3a7f6 phone_number:string phone_code_hash:string phone_code:string = Bool; +account.sendVerifyEmailCode#7011509f email:string = account.SentEmailCode; +account.verifyEmail#ecba39db email:string code:string = Bool; +account.initTakeoutSession#f05b4804 flags:# contacts:flags.0?true message_users:flags.1?true message_chats:flags.2?true message_megagroups:flags.3?true message_channels:flags.4?true files:flags.5?true file_max_size:flags.5?int = account.Takeout; +account.finishTakeoutSession#1d2652ee flags:# success:flags.0?true = Bool; +account.confirmPasswordEmail#8fdf1920 code:string = Bool; +account.resendPasswordEmail#7a7f2a15 = Bool; +account.cancelPasswordEmail#c1cbd5b6 = Bool; +account.getContactSignUpNotification#9f07c728 = Bool; +account.setContactSignUpNotification#cff43f61 silent:Bool = Bool; +account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates; +account.getWallPaper#fc8ddbea wallpaper:InputWallPaper = WallPaper; +account.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper; +account.saveWallPaper#6c5a5b37 wallpaper:InputWallPaper unsave:Bool settings:WallPaperSettings = Bool; +account.installWallPaper#feed5769 wallpaper:InputWallPaper settings:WallPaperSettings = Bool; +account.resetWallPapers#bb3b9804 = Bool; +account.getAutoDownloadSettings#56da0b3f = account.AutoDownloadSettings; +account.saveAutoDownloadSettings#76f36233 flags:# low:flags.0?true high:flags.1?true settings:AutoDownloadSettings = Bool; +account.uploadTheme#1c3db333 flags:# file:InputFile thumb:flags.0?InputFile file_name:string mime_type:string = Document; +account.createTheme#8432c21f flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme; +account.updateTheme#5cb367d5 flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?InputThemeSettings = Theme; +account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool; +account.installTheme#7ae43737 flags:# dark:flags.0?true format:flags.1?string theme:flags.1?InputTheme = Bool; +account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme; +account.getThemes#285946f8 format:string hash:int = account.Themes; +account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool; +account.getContentSettings#8b9b4dae = account.ContentSettings; +account.getMultiWallPapers#65ad71dc wallpapers:Vector = Vector; + +users.getUsers#d91a548 id:Vector = Vector; +users.getFullUser#ca30a5b1 id:InputUser = UserFull; +users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector = Bool; + +contacts.getContactIDs#2caa4a42 hash:int = Vector; +contacts.getStatuses#c4a353ee = Vector; +contacts.getContacts#c023849f hash:int = contacts.Contacts; +contacts.importContacts#2c800be5 contacts:Vector = contacts.ImportedContacts; +contacts.deleteContacts#96a0e00 id:Vector = Updates; +contacts.deleteByPhones#1013fd9e phones:Vector = Bool; +contacts.block#332b49fc id:InputUser = Bool; +contacts.unblock#e54100bd id:InputUser = Bool; +contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked; +contacts.search#11f812d8 q:string limit:int = contacts.Found; +contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer; +contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers; +contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool; +contacts.resetSaved#879537f1 = Bool; +contacts.getSaved#82f1e39f = Vector; +contacts.toggleTopPeers#8514bdda enabled:Bool = Bool; +contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates; +contacts.acceptContact#f831a20f id:InputUser = Updates; +contacts.getLocated#d348bc44 flags:# background:flags.1?true geo_point:InputGeoPoint self_expires:flags.0?int = Updates; + +messages.getMessages#63c66506 id:Vector = messages.Messages; +messages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs; +messages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; +messages.search#8614ef68 flags:# peer:InputPeer q:string from_id:flags.0?InputUser filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages; +messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages; +messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory; +messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages; +messages.receivedMessages#5a954c0 max_id:int = Vector; +messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool; +messages.sendMessage#520c3870 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates; +messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int = Updates; +messages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true grouped:flags.9?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int = Updates; +messages.reportSpam#cf1592db peer:InputPeer = Bool; +messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings; +messages.report#bd82b658 peer:InputPeer id:Vector reason:ReportReason = Bool; +messages.getChats#3c6aa187 id:Vector = messages.Chats; +messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull; +messages.editChatTitle#dc452855 chat_id:int title:string = Updates; +messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates; +messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates; +messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates; +messages.createChat#9cb126e users:Vector title:string = Updates; +messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig; +messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat; +messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat; +messages.discardEncryption#edd923c5 chat_id:int = Bool; +messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool; +messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool; +messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage; +messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage; +messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage; +messages.receivedQueue#55a5bb66 max_qts:int = Vector; +messages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool; +messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages; +messages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers; +messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers; +messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia; +messages.exportChatInvite#df7534c peer:InputPeer = ExportedChatInvite; +messages.checkChatInvite#3eadb1bb hash:string = ChatInvite; +messages.importChatInvite#6c50051c hash:string = Updates; +messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet; +messages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult; +messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool; +messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates; +messages.getMessagesViews#c4c8a55d peer:InputPeer id:Vector increment:Bool = Vector; +messages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bool; +messages.migrateChat#15a3b8e3 chat_id:int = Updates; +messages.searchGlobal#bf7225a4 flags:# folder_id:flags.0?int q:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; +messages.reorderStickerSets#78337739 flags:# masks:flags.0?true order:Vector = Bool; +messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document; +messages.searchGifs#bf9a776b q:string offset:int = messages.FoundGifs; +messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs; +messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool; +messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults; +messages.setInlineBotResults#eb5ea206 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM = Bool; +messages.sendInlineBotResult#220815b0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int = Updates; +messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData; +messages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int = Updates; +messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Bool; +messages.getBotCallbackAnswer#810a9fec flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes = messages.BotCallbackAnswer; +messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool; +messages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs; +messages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool; +messages.getAllDrafts#6a3f8d65 = Updates; +messages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers; +messages.readFeaturedStickers#5b118126 id:Vector = Bool; +messages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers; +messages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool; +messages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool; +messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers; +messages.getMaskStickers#65b8c79f hash:int = messages.AllStickers; +messages.getAttachedStickers#cc5b67cc media:InputStickeredMedia = Vector; +messages.setGameScore#8ef8ecc0 flags:# edit_message:flags.0?true force:flags.1?true peer:InputPeer id:int user_id:InputUser score:int = Updates; +messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:flags.1?true id:InputBotInlineMessageID user_id:InputUser score:int = Bool; +messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores; +messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores; +messages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats; +messages.getAllChats#eba80ff0 except_ids:Vector = messages.Chats; +messages.getWebPage#32ca8f91 url:string hash:int = WebPage; +messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool; +messages.reorderPinnedDialogs#3b1adf37 flags:# force:flags.0?true folder_id:int order:Vector = Bool; +messages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs; +messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector = Bool; +messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool; +messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia; +messages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates; +messages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers; +messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool; +messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory; +messages.getRecentLocations#bbc45b09 peer:InputPeer limit:int hash:int = messages.Messages; +messages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int = Updates; +messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile; +messages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets; +messages.getSplitRanges#1cff7e08 = Vector; +messages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool; +messages.getDialogUnreadMarks#22e24e22 = Vector; +messages.clearAllDrafts#7e58ee9c = Bool; +messages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true peer:InputPeer id:int = Updates; +messages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector = Updates; +messages.getPollResults#73bb643b peer:InputPeer msg_id:int = Updates; +messages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines; +messages.getStatsURL#812c2ae6 flags:# dark:flags.0?true peer:InputPeer params:string = StatsURL; +messages.editChatAbout#def60797 peer:InputPeer about:string = Bool; +messages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates; +messages.getEmojiKeywords#35a0e062 lang_code:string = EmojiKeywordsDifference; +messages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference; +messages.getEmojiKeywordsLanguages#4e9963b2 lang_codes:Vector = Vector; +messages.getEmojiURL#d5b10c26 lang_code:string = EmojiURL; +messages.getSearchCounters#732eef00 peer:InputPeer filters:Vector = Vector; +messages.requestUrlAuth#e33f5613 peer:InputPeer msg_id:int button_id:int = UrlAuthResult; +messages.acceptUrlAuth#f729ea98 flags:# write_allowed:flags.0?true peer:InputPeer msg_id:int button_id:int = UrlAuthResult; +messages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool; +messages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Messages; +messages.getScheduledMessages#bdbb0464 peer:InputPeer id:Vector = messages.Messages; +messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector = Updates; +messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector = Updates; +messages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList; +messages.toggleStickerSets#b5052fea flags:# uninstall:flags.0?true archive:flags.1?true unarchive:flags.2?true stickersets:Vector = Bool; +messages.getDialogFilters#f19ed96d = Vector; +messages.getSuggestedDialogFilters#a29cd42c = Vector; +messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool; +messages.updateDialogFiltersOrder#c563c1e4 order:Vector = Bool; +messages.getOldFeaturedStickers#5fe7025b offset:int limit:int hash:int = messages.FeaturedStickers; + +updates.getState#edd4882a = updates.State; +updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; +updates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference; + +photos.updateProfilePhoto#f0bb5152 id:InputPhoto = UserProfilePhoto; +photos.uploadProfilePhoto#4f32c098 file:InputFile = photos.Photo; +photos.deletePhotos#87cf7f2f id:Vector = Vector; +photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos; + +upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool; +upload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File; +upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool; +upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile; +upload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile; +upload.reuploadCdnFile#9b2754a8 file_token:bytes request_token:bytes = Vector; +upload.getCdnFileHashes#4da54231 file_token:bytes offset:int = Vector; +upload.getFileHashes#c7025931 location:InputFileLocation offset:int = Vector; + +help.getConfig#c4f9186b = Config; +help.getNearestDc#1fb33026 = NearestDc; +help.getAppUpdate#522d5a7d source:string = help.AppUpdate; +help.getInviteText#4d392343 = help.InviteText; +help.getSupport#9cdf08cd = help.Support; +help.getAppChangelog#9010ef6f prev_app_version:string = Updates; +help.setBotUpdatesStatus#ec22cfcd pending_updates_count:int message:string = Bool; +help.getCdnConfig#52029342 = CdnConfig; +help.getRecentMeUrls#3dc0f114 referer:string = help.RecentMeUrls; +help.getTermsOfServiceUpdate#2ca51fd1 = help.TermsOfServiceUpdate; +help.acceptTermsOfService#ee72f79a id:DataJSON = Bool; +help.getDeepLinkInfo#3fedc75f path:string = help.DeepLinkInfo; +help.getAppConfig#98914110 = JSONValue; +help.saveAppLog#6f02f748 events:Vector = Bool; +help.getPassportConfig#c661ad08 hash:int = help.PassportConfig; +help.getSupportName#d360e72c = help.SupportName; +help.getUserInfo#38a08d3 user_id:InputUser = help.UserInfo; +help.editUserInfo#66b91b70 user_id:InputUser message:string entities:Vector = help.UserInfo; +help.getPromoData#c0977421 = help.PromoData; +help.hidePromoData#1e251c95 peer:InputPeer = Bool; + +channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool; +channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages; +channels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory; +channels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector = Bool; +channels.getMessages#ad8c9a23 channel:InputChannel id:Vector = messages.Messages; +channels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants; +channels.getParticipant#546dd7a6 channel:InputChannel user_id:InputUser = channels.ChannelParticipant; +channels.getChannels#a7f6bbb id:Vector = messages.Chats; +channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull; +channels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates; +channels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates; +channels.editTitle#566decd0 channel:InputChannel title:string = Updates; +channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates; +channels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool; +channels.updateUsername#3514b3de channel:InputChannel username:string = Bool; +channels.joinChannel#24b524c5 channel:InputChannel = Updates; +channels.leaveChannel#f836aa95 channel:InputChannel = Updates; +channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector = Updates; +channels.deleteChannel#c0111fe3 channel:InputChannel = Updates; +channels.exportMessageLink#ceb77163 channel:InputChannel id:int grouped:Bool = ExportedMessageLink; +channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; +channels.getAdminedPublicChannels#f8b036af flags:# by_location:flags.0?true check_limit:flags.1?true = messages.Chats; +channels.editBanned#72796912 channel:InputChannel user_id:InputUser banned_rights:ChatBannedRights = Updates; +channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector max_id:long min_id:long limit:int = channels.AdminLogResults; +channels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool; +channels.readMessageContents#eab5dc38 channel:InputChannel id:Vector = Bool; +channels.deleteHistory#af369d42 channel:InputChannel max_id:int = Bool; +channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates; +channels.getLeftChannels#8341ecc0 offset:int = messages.Chats; +channels.getGroupsForDiscussion#f5dad378 = messages.Chats; +channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool; +channels.editCreator#8f38cd1f channel:InputChannel user_id:InputUser password:InputCheckPasswordSRP = Updates; +channels.editLocation#58e63f6d channel:InputChannel geo_point:InputGeoPoint address:string = Bool; +channels.toggleSlowMode#edd49ef0 channel:InputChannel seconds:int = Updates; +channels.getInactiveChannels#11e831ee = messages.InactiveChats; + +bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON; +bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool; +bots.setBotCommands#805d46f6 commands:Vector = Bool; + +payments.getPaymentForm#99f09745 msg_id:int = payments.PaymentForm; +payments.getPaymentReceipt#a092a980 msg_id:int = payments.PaymentReceipt; +payments.validateRequestedInfo#770a8e74 flags:# save:flags.0?true msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo; +payments.sendPaymentForm#2b8879b3 flags:# msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials = payments.PaymentResult; +payments.getSavedInfo#227d824b = payments.SavedInfo; +payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool; +payments.getBankCardData#2e79d779 number:string = payments.BankCardData; + +stickers.createStickerSet#f1036780 flags:# masks:flags.0?true animated:flags.1?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector = messages.StickerSet; +stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; +stickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet; +stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet; +stickers.setStickerSetThumb#9a364e30 stickerset:InputStickerSet thumb:InputDocument = messages.StickerSet; + +phone.getCallConfig#55451fa9 = DataJSON; +phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; +phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall; +phone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall; +phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool; +phone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates; +phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates; +phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool; + +langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference; +langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector; +langpack.getDifference#cd984aa5 lang_pack:string lang_code:string from_version:int = LangPackDifference; +langpack.getLanguages#42c6978f lang_pack:string = Vector; +langpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLanguage; + +folders.editPeerFolders#6847d0ab folder_peers:Vector = Updates; +folders.deleteFolder#1c295881 folder_id:int = Updates; + +stats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats; +stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph; diff --git a/src/danog/MadelineProto/TON/InternalDoc.php b/src/danog/MadelineProto/TON/InternalDoc.php index ce5766ba..3da34156 100644 --- a/src/danog/MadelineProto/TON/InternalDoc.php +++ b/src/danog/MadelineProto/TON/InternalDoc.php @@ -918,6 +918,8 @@ class InternalDoc extends APIFactory * @param \Generator|Promise $a Promise A * @param \Generator|Promise $b Promise B * + * @psalm-suppress InvalidScope + * * @return Promise */ public function after($a, $b) @@ -1009,6 +1011,8 @@ class InternalDoc extends APIFactory * @param ?\Generator|Promise $actual Promise to resolve instead of $promise * @param string $file File * + * @psalm-suppress InvalidScope + * * @return Promise|mixed */ public function callFork($promise, $actual = null, $file = '') @@ -1078,7 +1082,7 @@ class InternalDoc extends APIFactory * @param integer $operation Locking mode * @param float $polling Polling interval * - * @return Promise + * @return Promise */ public function flock(string $file, int $operation, float $polling = 0.1) { @@ -1110,6 +1114,8 @@ class InternalDoc extends APIFactory * @param object $obj Object * @param string $var Attribute name * + * @psalm-suppress InvalidScope + * * @return mixed * @access public */ @@ -1177,11 +1183,11 @@ class InternalDoc extends APIFactory * * @param string $hwat String to escape * - * @return void + * @return string */ public function markdownEscape(string $hwat): string { - return \danog\MadelineProto\Tools::markdownEscape($hwat); + return \danog\MadelineProto\StrTools::markdownEscape($hwat); } /** * Call lite method. @@ -1197,6 +1203,17 @@ class InternalDoc extends APIFactory { return $this->__call(__FUNCTION__, [$methodName, $args, $aargs, $extra]); } + /** + * Escape method name. + * + * @param string $method Method name + * + * @return string + */ + public function methodEscape(string $method): string + { + return \danog\MadelineProto\StrTools::methodEscape($method); + } /** * Convert double to binary version. * @@ -1281,7 +1298,7 @@ class InternalDoc extends APIFactory * * @param string $prompt Prompt * - * @return Promise + * @return Promise */ public function readLine(string $prompt = '') { @@ -1293,6 +1310,8 @@ class InternalDoc extends APIFactory * @param \Throwable $e Exception * @param string $file File where the strand started * + * @psalm-suppress InvalidScope + * * @return void */ public function rethrow(\Throwable $e, $file = ''): void @@ -1328,6 +1347,8 @@ class InternalDoc extends APIFactory * @param string $var Attribute name * @param mixed $val Attribute value * + * @psalm-suppress InvalidScope + * * @return mixed * @access public */ @@ -1379,7 +1400,7 @@ class InternalDoc extends APIFactory */ public function toCamelCase(string $input): string { - return \danog\MadelineProto\Tools::toCamelCase($input); + return \danog\MadelineProto\StrTools::toCamelCase($input); } /** * Convert to snake_case. @@ -1390,7 +1411,18 @@ class InternalDoc extends APIFactory */ public function toSnakeCase(string $input): string { - return \danog\MadelineProto\Tools::toSnakeCase($input); + return \danog\MadelineProto\StrTools::toSnakeCase($input); + } + /** + * Escape type name. + * + * @param string $type String to escape + * + * @return string + */ + public function typeEscape(string $type): string + { + return \danog\MadelineProto\StrTools::typeEscape($type); } /** * Unpack binary double. diff --git a/src/danog/MadelineProto/Tools.php b/src/danog/MadelineProto/Tools.php index f94a5bf2..0377c541 100644 --- a/src/danog/MadelineProto/Tools.php +++ b/src/danog/MadelineProto/Tools.php @@ -41,7 +41,7 @@ use function Amp\Promise\wait; /** * Some tools. */ -abstract class Tools +abstract class Tools extends StrTools { /** * Sanify TL obtained from JSON for TL serialization. @@ -628,33 +628,6 @@ abstract class Tools { return \is_array($var) || $var instanceof \ArrayAccess && $var instanceof \Traversable && $var instanceof \Countable; } - /** - * Convert to camelCase. - * - * @param string $input String - * - * @return string - */ - public static function toCamelCase(string $input): string - { - return \lcfirst(\str_replace('_', '', \ucwords($input, '_'))); - } - /** - * Convert to snake_case. - * - * @param string $input String - * - * @return string - */ - public static function toSnakeCase(string $input): string - { - \preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); - $ret = $matches[0]; - foreach ($ret as &$match) { - $match = $match == \strtoupper($match) ? \strtolower($match) : \lcfirst($match); - } - return \implode('_', $ret); - } /** * Create array. * @@ -801,17 +774,6 @@ abstract class Tools { return \end($what); } - /** - * Escape string for markdown. - * - * @param string $hwat String to escape - * - * @return void - */ - public static function markdownEscape(string $hwat): string - { - return \str_replace('_', '\\_', $hwat); - } /** * Whether this is altervista. * diff --git a/tools/build_docs.php b/tools/build_docs.php index 64f88017..14967dc1 100755 --- a/tools/build_docs.php +++ b/tools/build_docs.php @@ -13,6 +13,8 @@ use danog\MadelineProto\API; use danog\MadelineProto\APIFactory; +use danog\MadelineProto\Logger; +use danog\MadelineProto\Magic; use danog\MadelineProto\MTProto; use danog\MadelineProto\TON\API as TONAPI; use danog\MadelineProto\TON\APIFactory as TONAPIFactory; @@ -22,83 +24,43 @@ use danog\MadelineProto\TON\Lite; require 'vendor/autoload.php'; -$param = 1; -\danog\MadelineProto\Magic::classExists(); -\danog\MadelineProto\Logger::constructor($param); -$logger = \danog\MadelineProto\Logger::$default; - +Magic::classExists(); +Logger::constructor(1); +$logger = Logger::$default; \set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']); -\danog\MadelineProto\Logger::log('Copying readme...', \danog\MadelineProto\Logger::NOTICE); +$logger->logger('Merging constructor localization...', Logger::NOTICE); +mergeExtracted(); -\file_put_contents('docs/docs/index.md', '--- -title: MadelineProto documentation -description: PHP client/server for the telegram MTProto protocol (a better tg-cli) -image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png ---- -'.\str_replace('logger('Loading schemas...', Logger::NOTICE); +$schemas = loadSchemas(); -$layer_list = ''; -$tempRes = \glob("$d/schemas/TL_telegram_*"); -$res = []; -foreach ($tempRes as $file) { - $layer = \preg_replace(['/.*telegram_v/', '/\..+/'], '', $file); - $res[$layer] = $file; -} -\ksort($res); - -foreach (\array_slice($res, 0, -1) as $layer => $file) { - $layer = "v$layer"; - $docs[] = [ - 'tl_schema' => ['telegram' => $file], - 'title' => 'MadelineProto API documentation (layer '.$layer.')', - 'description' => 'MadelineProto API documentation (layer '.$layer.')', - 'output_dir' => "$d/docs/old_docs/API_docs_".$layer, - 'readme' => true, - ]; - $layer_list .= '[Layer '.$layer.'](API_docs_'.$layer.'/) -'; -} -$layer = \array_keys($res); -$layer = \end($layer); +$logger->logger('Upgrading layer...', Logger::NOTICE); +$layer = maxLayer($schemas); +layerUpgrade($layer); +$logger->logger('Initing docs...', Logger::NOTICE); $docs = [ -/* [ - 'tl_schema' => ['td' => "$d/schemas/TL_td.tl"], - 'title' => 'MadelineProto API documentation (td-lib)', - 'description' => 'MadelineProto API documentation (td-lib)', - 'output_dir' => "$d/docs/docs/TD_docs", - 'readme' => false, - 'td' => true, - ],*/ [ - 'tl_schema' => ['mtproto' => "$d/schemas/TL_mtproto_v1.json"], + 'tl_schema' => ['mtproto' => "$d/schemas/TL_mtproto_v1.tl"], 'title' => 'MadelineProto API documentation (mtproto)', 'description' => 'MadelineProto API documentation (mtproto)', 'output_dir' => "$d/docs/docs/MTProto_docs", + 'template' => "$d/docs/template", 'readme' => false, ], [ - 'tl_schema' => ['telegram' => "$d/schemas/TL_telegram_v$layer.tl", 'calls' => "$d/schemas/TL_calls.tl", 'secret' => "$d/schemas/TL_secret.tl", 'td' => "$d/schemas/TL_td.tl"], + 'tl_schema' => ['telegram' => "$d/schemas/TL_telegram_v$layer.tl", 'secret' => "$d/schemas/TL_secret.tl", 'td' => "$d/schemas/TL_td.tl"], 'title' => "MadelineProto API documentation (layer $layer)", 'description' => "MadelineProto API documentation (layer $layer)", 'output_dir' => "$d/docs/docs/API_docs", + 'template' => "$d/docs/template", 'readme' => false, ], ]; +$docs = \array_merge($docs, initDocs($schemas)); -$doc = \file_get_contents('docs/docs/docs/USING_METHODS.md'); -$doc = \preg_replace('|here \(layer \d+\)|', "here (layer $layer)", $doc); -\file_put_contents('docs/docs/docs/USING_METHODS.md', $doc); - -\file_put_contents('docs/old_docs/README.md', '--- -title: Documentations of old mtproto layers -description: Documentation of old mtproto layers ---- -# Documentation of old mtproto layers - -'.$layer_list); - +$logger->logger('Creating annotations...', Logger::NOTICE); $doc = new \danog\MadelineProto\AnnotationsBuilder( $logger, $docs[1], @@ -112,17 +74,15 @@ $doc = new \danog\MadelineProto\AnnotationsBuilder( ); $doc->mkAnnotations(); -$ton = [ - 'tl_schema' => [ - 'lite_api' => "$d/schemas/TON/lite_api.tl", - 'ton_api' => "$d/schemas/TON/ton_api.tl", - //'tonlib_api' => "$d/schemas/TON/tonlib_api.tl", - ] -]; - $doc = new \danog\MadelineProto\AnnotationsBuilder( $logger, - $ton, + [ + 'tl_schema' => [ + 'lite_api' => "$d/schemas/TON/lite_api.tl", + 'ton_api' => "$d/schemas/TON/ton_api.tl", + //'tonlib_api' => "$d/schemas/TON/tonlib_api.tl", + ] + ], \dirname(__FILE__).'/../src/danog/MadelineProto/TON/InternalDoc.php', [ 'API' => TONAPI::class, @@ -132,6 +92,10 @@ $doc = new \danog\MadelineProto\AnnotationsBuilder( 'danog\\MadelineProto\\TON' ); $doc->mkAnnotations(); + + + +$logger->logger('Creating docs...', Logger::NOTICE); foreach ($docs as $settings) { $doc = new \danog\MadelineProto\DocsBuilder($logger, $settings); $doc->mkDocs(); @@ -139,6 +103,7 @@ foreach ($docs as $settings) { \chdir(__DIR__.'/..'); +$logger->logger('Fixing readme...', Logger::NOTICE); $orderedfiles = []; $order = [ 'CREATING_A_CLIENT', @@ -228,6 +193,7 @@ foreach ($orderedfiles as $key => $filename) { } } +$logger->logger('Fixing readme...', Logger::NOTICE); $readme = \explode('## ', \file_get_contents('README.md')); foreach ($readme as &$section) { if (\explode("\n", $section)[0] === 'Documentation') { diff --git a/tools/build_docs/layerUpgrade.php b/tools/build_docs/layerUpgrade.php new file mode 100644 index 00000000..8225c757 --- /dev/null +++ b/tools/build_docs/layerUpgrade.php @@ -0,0 +1,46 @@ + (\d+)/", $doc, $matches); + $prevLayer = (int) $matches[1]; + + if ($prevLayer === $layer) { + return; + } + \preg_match_all("/const V = (\d+)/", $doc, $matches); + $prevVersion = $matches[1][1]; + $version = $prevVersion + 1; + + $doc = \str_replace( + [ + "'layer' => $prevLayer", + "TL_telegram_$prevLayer", + "const V = $prevVersion" + ], + [ + "'layer' => $layer", + "TL_telegram_$layer", + "const V = $version" + ], + $doc + ); + \file_put_contents('src/danog/MadelineProto/MTProto.php', $doc); +} diff --git a/tools/build_docs/merge.php b/tools/build_docs/merge.php new file mode 100644 index 00000000..ba89cd94 --- /dev/null +++ b/tools/build_docs/merge.php @@ -0,0 +1,25 @@ + $value) { + $key = \preg_replace(['|flags\.\d+[?]|', '/Vector[<].*/'], ['', 'Vector t'], $key); + $key = \str_replace('param_hash_type_int', 'param_hash_type_Vector t', $key); + Lang::$lang['en'][$key] = $value; + } + foreach (Lang::$lang['en'] as $key => $value) { + if ($value === '') { + unset(Lang::$lang['en'][$key]); + } + } + foreach (\json_decode(\file_get_contents('docs/template/disallow.json'), true) as $key => $value) { + Lang::$lang['en'][$key] = $value; + } +} diff --git a/tools/build_docs/schemas.php b/tools/build_docs/schemas.php new file mode 100644 index 00000000..169d829b --- /dev/null +++ b/tools/build_docs/schemas.php @@ -0,0 +1,63 @@ + $file) { + $layer = "v$layer"; + $docs[] = [ + 'tl_schema' => ['telegram' => $file], + 'title' => 'MadelineProto API documentation (layer '.$layer.')', + 'description' => 'MadelineProto API documentation (layer '.$layer.')', + 'output_dir' => \getcwd()."/docs/old_docs/API_docs_".$layer, + 'template' => \getcwd()."/docs/template", + 'readme' => true, + ]; + $layer_list .= "[Layer $layer](API_docs_$layer/) \n"; + } + \file_put_contents('docs/old_docs/README.md', '--- +title: Documentation of old mtproto layers +description: Documentation of old mtproto layers +--- +# Documentation of old mtproto layers + +'.$layer_list); + return $docs; +} diff --git a/tools/merge.php b/tools/merge.php deleted file mode 100644 index 1084cf17..00000000 --- a/tools/merge.php +++ /dev/null @@ -1,16 +0,0 @@ - $value) { - $key = \preg_replace(['|flags\.\d+[?]|', '|[<]|', '|[>]|'], ['', ' ', ''], $key); - Lang::$lang['en'][$key] = $value; -} -foreach (Lang::$lang['en'] as $key => $value) { - if ($value === '') { - unset(Lang::$lang['en'][$key]); - } -} -DocsBuilder::addToLang($key, $value, true); diff --git a/tools/static.php b/tools/static.php index 678eda5e..8762cb05 100644 --- a/tools/static.php +++ b/tools/static.php @@ -47,8 +47,8 @@ foreach (new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryI } $filename = 'README.md'; +$new = \str_replace($findDocs, $replaceDocs, $old = \file_get_contents($filename)); +do { + \file_put_contents($filename, $new); $new = \str_replace($findDocs, $replaceDocs, $old = \file_get_contents($filename)); - do { - \file_put_contents($filename, $new); - $new = \str_replace($findDocs, $replaceDocs, $old = \file_get_contents($filename)); - } while ($old !== $new); +} while ($old !== $new);