# MadelineProto, a PHP MTProto telegram client Created by Daniil Gentili `#StandWithUkraine ๐Ÿ‡บ๐Ÿ‡ฆ` [![status-badge](https://ci.daniil.it/api/badges/danog/MadelineProto/status.svg?branch=v8)](https://ci.daniil.it/danog/MadelineProto/branches/v8) Do join the official channel, [@MadelineProto](https://t.me/MadelineProto) and the [support groups](https://t.me/pwrtelegramgroup)! Approved by Telegram! ## What's this? This library can be used to easily interact with Telegram **without** the bot API, just like the official apps. It can login with a phone number (MTProto API), or with a bot token (MTProto API, **no bot API involved!**). [It is now fully async](https://docs.madelineproto.xyz/docs/ASYNC.html)! ## Getting started ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html)) ```php start(); $me = $MadelineProto->getSelf(); $MadelineProto->logger($me); if (!$me['bot']) { $MadelineProto->messages->sendMessage(peer: '@stickeroptimizerbot', message: "/start"); $MadelineProto->channels->joinChannel(channel: '@MadelineProto'); try { $MadelineProto->messages->importChatInvite(hash: 'https://t.me/+Por5orOjwgccnt2w'); } catch (\danog\MadelineProto\RPCErrorException $e) { $MadelineProto->logger($e); } } $MadelineProto->echo('OK, done!'); ``` Try running this code in a browser or in a console! Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgroup) the error message and the `MadelineProto.log` file that was created in the same directory (if running from a browser). ## Made with MadelineProto The following open source projects were created using MadelineProto: you can directly install them, or explore the source code as direct examples on how to use MadelineProto's many features! * [TelegramApiServer](https://github.com/xtrime-ru/TelegramApiServer) - Fast, simple, async php telegram api server: an HTTP JSON API for MadelineProto! * [`downloadRenameBot.php`](https://github.com/danog/MadelineProto/blob/v8/examples/downloadRenameBot.php) - Download files by URL and rename Telegram files using this async parallelized bot! * [`secret_bot.php`](https://github.com/danog/MadelineProto/blob/v8/examples/secret_bot.php) - Secret chat bot! * [`pipesbot.php`](https://github.com/danog/MadelineProto/blob/v8/examples/pipesbot.php) - Creating inline bots and using other inline bots via a userbot! * [`bot.php`](https://github.com/danog/MadelineProto/blob/v8/examples/bot.php) - Examples for sending normal messages, downloading any media! Want to add your own open-source project to this list? [Click here!](https://docs.madelineproto.xyz/FOSS.html) ## Documentation * [Creating a client](https://docs.madelineproto.xyz/docs/CREATING_A_CLIENT.html) * [Login](https://docs.madelineproto.xyz/docs/LOGIN.html) * [Getting permission to use the telegram API](https://docs.madelineproto.xyz/docs/LOGIN.html#getting-permission-to-use-the-telegram-api) * [Automatic](https://docs.madelineproto.xyz/docs/LOGIN.html#automatic) * [Manual (user)](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-user) * [API ID](https://docs.madelineproto.xyz/docs/LOGIN.html#api-id) * [Manual (bot)](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-bot) * [Logout](https://docs.madelineproto.xyz/docs/LOGIN.html#logout) * [Changing 2FA password](https://docs.madelineproto.xyz/docs/LOGIN.html#changing-2fa-password) * [Features](https://docs.madelineproto.xyz/docs/FEATURES.html) * [Requirements](https://docs.madelineproto.xyz/docs/REQUIREMENTS.html) * [Installation](https://docs.madelineproto.xyz/docs/INSTALLATION.html) * [Simple](https://docs.madelineproto.xyz/docs/INSTALLATION.html#simple) * [Composer from existing project](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-existing-project) * [Composer from scratch](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-scratch) * [Handling updates (new messages & other events)](https://docs.madelineproto.xyz/docs/UPDATES.html) * [Async Event driven](https://docs.madelineproto.xyz/docs/UPDATES.html#async-event-driven) * [Built-in database driver](https://docs.madelineproto.xyz/docs/UPDATES.html#built-in-database-driver) * [Self-restart on webhosts](https://docs.madelineproto.xyz/docs/UPDATES.html#self-restart-on-webhosts) * [Async Event driven multi-account](https://docs.madelineproto.xyz/docs/UPDATES.html#async-event-driven-multiaccount) * [Noop (default)](https://docs.madelineproto.xyz/docs/UPDATES.html#noop) * [Database](https://docs.madelineproto.xyz/docs/DATABASE.html) * [\danog\MadelineProto\Settings\Database\Memory: Memory backend settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Database/Memory.html) * [\danog\MadelineProto\Settings\Database\Mysql: MySQL backend settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Database/Mysql.html) * [\danog\MadelineProto\Settings\Database\Postgres: Postgres backend settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Database/Postgres.html) * [\danog\MadelineProto\Settings\Database\Redis: Redis backend settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Database/Redis.html) * [Settings](https://docs.madelineproto.xyz/docs/SETTINGS.html) * [AppInfo: App information.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/AppInfo.html) * [Auth: Cryptography settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Auth.html) * [Connection: Connection settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Connection.html) * [Files: File management settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Files.html) * [Logger: Logger settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Logger.html) * [Peer: Peer database settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Peer.html) * [Pwr: PWRTelegram settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Pwr.html) * [RPC: RPC settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/RPC.html) * [SecretChats: Secret chat settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/SecretChats.html) * [Serialization: Serialization settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Serialization.html) * [TLSchema: TL schema settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/TLSchema.html) * [Templates: Web and CLI template settings for login.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Templates.html) * [VoIP: VoIP settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/VoIP.html) * [Database\Memory: Memory backend settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Database/Memory.html) * [Database\Mysql: MySQL backend settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Database/Mysql.html) * [Database\Postgres: Postgres backend settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Database/Postgres.html) * [Database\Redis: Redis backend settings.](https://docs.madelineproto.xyz/PHP/danog/MadelineProto/Settings/Database/Redis.html) * [Getting info about the current user](https://docs.madelineproto.xyz/docs/SELF.html) * [Exceptions](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html) * [List of exception types](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html#list-of-exception-types) * [Pretty TL trace](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html#pretty-tl-trace) * [Getting the TL trace](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html#getting-the-tl-trace) * [Avoiding FLOOD_WAITs](https://docs.madelineproto.xyz/docs/FLOOD_WAIT.html) * [Logging](https://docs.madelineproto.xyz/docs/LOGGING.html) * [Telegram VoIP phone calls](https://docs.madelineproto.xyz/docs/CALLS.html) * [Requesting a call](https://docs.madelineproto.xyz/docs/CALLS.html#requesting-a-call) * [Playing mp3 files](https://docs.madelineproto.xyz/docs/CALLS.html#playing-mp3-files) * [Playing streams](https://docs.madelineproto.xyz/docs/CALLS.html#playing-streams) * [Changing audio quality](https://docs.madelineproto.xyz/docs/CALLS.html#changing-audio-quality) * [Putting it all together](https://docs.madelineproto.xyz/docs/CALLS.html#putting-it-all-together) * [Accepting calls](https://docs.madelineproto.xyz/docs/CALLS.html#accepting-calls) * [Uploading and downloading files](https://docs.madelineproto.xyz/docs/FILES.html) * [Bot API file IDs](https://docs.madelineproto.xyz/docs/FILES.html#bot-api-file-ids) * [Uploading & sending files](https://docs.madelineproto.xyz/docs/FILES.html#sending-files) * [Security notice](https://docs.madelineproto.xyz/docs/FILES.html#security-notice) * [Photos](https://docs.madelineproto.xyz/docs/FILES.html#inputmediauploadedphoto) * [Documents](https://docs.madelineproto.xyz/docs/FILES.html#inputmediauploadeddocument) * [Documents](https://docs.madelineproto.xyz/docs/FILES.html#documentattributefilename-to-send-a-document) * [Photos as documents](https://docs.madelineproto.xyz/docs/FILES.html#documentattributeimagesize-to-send-a-photo-as-document) * [GIFs](https://docs.madelineproto.xyz/docs/FILES.html#documentattributeanimated-to-send-a-gif) * [Videos](https://docs.madelineproto.xyz/docs/FILES.html#documentattributevideo-to-send-a-video) * [Audio & Voice](https://docs.madelineproto.xyz/docs/FILES.html#documentattributeaudio-to-send-an-audio-file) * [Uploading files](https://docs.madelineproto.xyz/docs/FILES.html#uploading-files) * [Reusing uploaded files](https://docs.madelineproto.xyz/docs/FILES.html#reusing-uploaded-files) * [Renaming files](https://docs.madelineproto.xyz/docs/FILES.html#renaming-files) * [Downloading files](https://docs.madelineproto.xyz/docs/FILES.html#downloading-files) * [Extracting download info](https://docs.madelineproto.xyz/docs/FILES.html#extracting-download-info) * [Downloading profile pictures](https://docs.madelineproto.xyz/docs/FILES.html#downloading-profile-pictures) * [Download to directory](https://docs.madelineproto.xyz/docs/FILES.html#download-to-directory) * [Download to file](https://docs.madelineproto.xyz/docs/FILES.html#download-to-file) * [Download to stream](https://docs.madelineproto.xyz/docs/FILES.html#download-to-stream) * [Download to callback](https://docs.madelineproto.xyz/docs/FILES.html#download-to-callback) * [Download to http-server](https://docs.madelineproto.xyz/docs/FILES.html#download-to-http-server) * [Download to browser](https://docs.madelineproto.xyz/docs/FILES.html#download-to-browser) * [Getting progress](https://docs.madelineproto.xyz/docs/FILES.html#getting-progress) * [Getting info about chats](https://docs.madelineproto.xyz/docs/CHAT_INFO.html) * [Full chat info with full list of participants](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#getPwrChat) * [Full chat info](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#getFullInfo) * [Reduced chat info (very fast)](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#getInfo) * [Just the chat ID (extremely fast)](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#getId) * [Getting all chats (dialogs)](https://docs.madelineproto.xyz/docs/DIALOGS.html) * [Dialog list](https://docs.madelineproto.xyz/docs/DIALOGS.html#getDialogs) * [Full dialog info](https://docs.madelineproto.xyz/docs/DIALOGS.html#getFullDialogs) * [Inline buttons](https://docs.madelineproto.xyz/docs/INLINE_BUTTONS.html) * [Secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html) * [Requesting secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#requesting-secret-chats) * [Accepting secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#accepting-secret-chats) * [Checking secret chat status](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#checking-secret-chat-status) * [Sending secret messages](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#sending-secret-messages) * [Using a proxy](https://docs.madelineproto.xyz/docs/PROXY.html) * [How to set a proxy](https://docs.madelineproto.xyz/docs/PROXY.html#how-to-set-a-proxy) * [Multiple proxies with automatic switch](https://docs.madelineproto.xyz/docs/PROXY.html#multiple-proxies-with-automatic-switch) * [Use pre-built MTProxy](https://docs.madelineproto.xyz/docs/PROXY.html#mtproxy) * [Use pre-built Socks5 proxy](https://docs.madelineproto.xyz/docs/PROXY.html#socks5-proxy) * [Use pre-built HTTP proxy](https://docs.madelineproto.xyz/docs/PROXY.html#http-proxy) * [Build your own proxy](https://docs.madelineproto.xyz/docs/PROXY.html#build-your-proxy) * [Async](https://docs.madelineproto.xyz/docs/ASYNC.html) * [Usage](https://docs.madelineproto.xyz/docs/ASYNC.html#usage) * [Async in event handler](https://docs.madelineproto.xyz/docs/ASYNC.html#async-in-event-handler) * [Multiple async](https://docs.madelineproto.xyz/docs/ASYNC.html#multiple-async) * [Ignored async](https://docs.madelineproto.xyz/docs/ASYNC.html#ignored-async) * [Combining async operations](https://docs.madelineproto.xyz/docs/ASYNC.html#combining-async-operations) * [Blocking async](https://docs.madelineproto.xyz/docs/ASYNC.html#blocking-async) * [MadelineProto and AMPHP async APIs](https://docs.madelineproto.xyz/docs/ASYNC.html#madelineproto-and-amphp-async-apis) * [Helper methods](https://docs.madelineproto.xyz/docs/ASYNC.html#helper-methods) * [Async sleep](https://docs.madelineproto.xyz/docs/ASYNC.html#async-sleep-does-not-block-the-main-thread) * [Async readline](https://docs.madelineproto.xyz/docs/ASYNC.html#async-readline-does-not-block-the-main-thread) * [Async echo](https://docs.madelineproto.xyz/docs/ASYNC.html#async-echo-does-not-block-the-main-thread) * [MadelineProto HTTP client](https://docs.madelineproto.xyz/docs/ASYNC.html#madelineproto-http-client) * [Async forking](https://docs.madelineproto.xyz/docs/ASYNC.html#async-forking-does-async-green-thread-forking) * [Async flock](https://docs.madelineproto.xyz/docs/ASYNC.html#async-flock) * [MadelineProto async loop APIs](https://docs.madelineproto.xyz/docs/ASYNC.html#async-loop-apis) * [Using methods](https://docs.madelineproto.xyz/docs/USING_METHODS.html) * [Named arguments (PHP 8+)](https://docs.madelineproto.xyz/docs/USING_METHODS.html#named-arguments) * [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) * [Entities (Markdown & HTML)](https://docs.madelineproto.xyz/docs/USING_METHODS.html#entities) * [reply_markup (keyboards & inline keyboards)](https://docs.madelineproto.xyz/docs/USING_METHODS.html#reply_markup) * [bot API objects](https://docs.madelineproto.xyz/docs/USING_METHODS.html#bot-api-objects) * [No result](https://docs.madelineproto.xyz/docs/USING_METHODS.html#no-result) * [Queues](https://docs.madelineproto.xyz/docs/USING_METHODS.html#queues) * [Multiple method calls](https://docs.madelineproto.xyz/docs/USING_METHODS.html#multiple-method-calls) * [FULL API Documentation with descriptions](https://docs.madelineproto.xyz/API_docs/methods/) * [Login](https://docs.madelineproto.xyz/docs/LOGIN.html) * [Change 2FA password: update2FA](https://docs.madelineproto.xyz/update2fa.html) * [Get all chats, broadcast a message to all chats: getDialogIds, getDialogs, getFullDialogs](https://docs.madelineproto.xyz/docs/DIALOGS.html) * [Get the full participant list of a channel/group/supergroup: getPwrChat](https://docs.madelineproto.xyz/getPwrChat.html) * [Get full info about a user/chat/supergroup/channel: getFullInfo](https://docs.madelineproto.xyz/getFullInfo.html) * [Get info about a user/chat/supergroup/channel: getInfo](https://docs.madelineproto.xyz/getInfo.html) * [Get the ID of a user/chat/supergroup/channel/update: getID](https://docs.madelineproto.xyz/getId.html) * [Get info about the currently logged-in user: getSelf](https://docs.madelineproto.xyz/getSelf.html) * [Upload or download files up to 2 GB: uploadFrom*, downloadTo*](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) * Abort a pending 2FA password reset, see here for more info ยป: account.declinePasswordReset * Accept QR code login token, logging in the app that generated it: auth.acceptLoginToken * 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 * Add an existing telegram user as contact: contacts.addContact * Add/remove sticker from recent stickers list: messages.saveRecentSticker * Adds a user to a chat and sends a service message on it: messages.addChatUser * 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 * 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 * Change authorization settings: account.changeAuthorizationSettings * Change default emoji reaction to use in the quick reaction menu: the value is synced across devices and can be fetched using help.getConfig, reactions_default field: messages.setDefaultReaction * Change group call settings: phone.toggleGroupCallSettings * Change media autodownload settings: account.saveAutoDownloadSettings * Change privacy settings of current account: account.setPrivacy * Change the chat theme of a certain chat: messages.setChatTheme * Change the default peer that should be used when sending messages to a specific group: messages.saveDefaultSendAs * Change the phone number of the current account: account.changePhone * Change the photo of a channel/supergroup: channels.editPhoto * Change the set of message reactions ยป that can be used in a certain group, supergroup or channel: messages.setChatAvailableReactions * Change the username of a supergroup/channel: channels.updateUsername * Changes chat name and sends a service message on it: messages.editChatTitle * Changes chat photo and sends a service message on it: messages.editChatPhoto * Changes the absolute position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot: stickers.changeStickerPosition * Changes username for the current user: account.updateUsername * Check if a username is free and can be assigned to a channel/supergroup: channels.checkUsername * Check if the 2FA recovery code sent using auth.requestPasswordRecovery is valid, before passing it to auth.recoverPassword: auth.checkRecoveryPassword * Check the validity of a chat invite link and get basic info about it: messages.checkChatInvite * Check whether chat history exported from another chat app can be imported into a specific Telegram chat, click here for more info ยป: messages.checkHistoryImportPeer * Check whether the given short name is available: stickers.checkShortName * Check whether the group call Server Forwarding Unit is currently receiving the streams with the specified WebRTC source IDs. : phone.checkGroupCall * Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase, official apps only: payments.canPurchasePremium * Clear all drafts: messages.clearAllDrafts * Clear bot commands for the specified bot scope and language code: bots.resetBotCommands * Clear recent stickers: messages.clearRecentStickers * Clear saved payment information: payments.clearSavedInfo * Complete the history import process, importing all messages into the chat. : messages.startHistoryImport * Confirm a phone number to cancel account deletion, for more info click here ยป: account.confirmPhone * Confirms receipt of messages by a client, cancels PUSH-notification sending: messages.receivedMessages * Convert a supergroup to a gigagroup, when requested by channel suggestions: channels.convertToGigagroup * Create a supergroup/channel: channels.createChannel * Create a group call or livestream: phone.createGroupCall * 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 chat: messages.deleteChat * Delete a chat invite: messages.deleteExportedChatInvite * Delete all installed wallpapers, reverting to the default wallpaper set: account.resetWallPapers * Delete all messages sent by a specific participant of a given supergroup: channels.deleteParticipantHistory * Delete all revoked chat invites: messages.deleteRevokedExportedChatInvites * Delete all temporary authorization keys except for the ones specified: auth.dropTempAuthKeys * Delete contacts by phone number: contacts.deleteByPhones * Delete messages in a channel/supergroup: channels.deleteMessages * Delete saved contacts: contacts.resetSaved * Delete scheduled messages: messages.deleteScheduledMessages * Delete stored Telegram Passport documents, for more info see the passport docs ยป: account.deleteSecureValue * Delete the entire phone call history: messages.deletePhoneCallHistory * Delete the history of a supergroup: channels.deleteHistory * Delete the user's account from the telegram servers: account.deleteAccount * Deletes a device by its token, stops sending PUSH-notifications to it: account.unregisterDevice * Deletes a user from a chat and sends a service message on it: messages.deleteChatUser * Deletes communication history: messages.deleteHistory * Deletes messages by their identifiers: messages.deleteMessages * Deletes profile photos. The method returns a list of successfully deleted photo IDs: photos.deletePhotos * Deletes several contacts from the list: contacts.deleteContacts * Deletes the user from the blacklist: contacts.unblock * Dismiss a suggestion, see here for more info ยป: help.dismissSuggestion * Dismiss or approve a chat join request related to a specific chat or channel: messages.hideChatJoinRequest * Dismiss or approve all join requests related to a specific chat or channel: messages.hideAllChatJoinRequests * Edit an exported chat invite: messages.editExportedChatInvite * Edit an inline bot message: messages.editInlineBotMessage * Edit information about a given group call participant: phone.editGroupCallParticipant * Edit location of geogroup: channels.editLocation * Edit message: messages.editMessage * 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 * Edit the title of a group call or livestream: phone.editGroupCallTitle * Edits notification settings from a given user/group, from all users/all groups: account.updateNotifySettings * Enable or disable content protection on a channel or chat: messages.toggleNoForwards * Enable or disable web bot attachment menu ยป: messages.toggleBotInAttachMenu * Enable/disable top peers: contacts.toggleTopPeers * Enable/disable message signatures in channels: channels.toggleSignatures * Export an invite link for a chat: messages.exportChatInvite * Fetch custom emoji stickers ยป: messages.getCustomEmojiDocuments * Fetch saved notification sounds: account.getSavedRingtones * 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 * Generate an invoice deep link: payments.exportInvoice * Get MTProxy/Public Service Announcement information: help.getPromoData * Get RTMP URL and stream key for RTMP livestreams. Can be used even before creating the actual RTMP livestream with phone.createGroupCall (the rtmp_stream flag must be set): phone.getGroupCallStreamRtmpUrl * Get Telegram Premium promotion information: help.getPremiumPromo * Get channel statistics: stats.getBroadcastStats * 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 discussion message from the associated discussion group of a channel to show it on top of the comment section, without actually joining the group: messages.getDiscussionMessage * Get folders: messages.getDialogFilters * Get instant view page: messages.getWebPage * Get message reaction list, along with the sender of each reaction: messages.getMessageReactionsList * Get message reactions ยป: messages.getMessagesReactions * Get message statistics: stats.getMessageStats * Get passport configuration: help.getPassportConfig * Get suggested folders: messages.getSuggestedDialogFilters * Get supergroup statistics: stats.getMegagroupStats * 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 list of peers that can be used to join a group call, presenting yourself as a specific user/channel: phone.getGroupCallJoinAs * Get a list of sponsored messages: channels.getSponsoredMessages * Get a payment form: payments.getPaymentForm * Get all archived stickers: messages.getArchivedStickers * Get all available chat themes: account.getChatThemes * Get all contacts: contacts.getSaved * Get all groups that can be used as discussion groups: channels.getGroupsForDiscussion * Get all installed stickers: messages.getAllStickers * Get all saved Telegram Passport documents, for more info see the passport docs ยป: account.getAllSecureValues * Get an invite link for a group call or livestream: phone.exportGroupCallInvite * Get and increase the view counter of a message sent or forwarded from a channel: messages.getMessagesViews * 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 chats in common with a user: messages.getCommonChats * Get configuration for CDN file downloads: help.getCdnConfig * Get contact by telegram IDs: contacts.getContactIDs * Get contacts near you: contacts.getLocated * Get count of online users in a chat: messages.getOnlines * Get days to live of account: account.getAccountTTL * Get dialog info of specified peers: messages.getPeerDialogs * Get dialogs manually marked as unread: messages.getDialogUnreadMarks * Get faved stickers: messages.getFavedStickers * Get featured stickers: messages.getFeaturedStickers * Get global privacy settings: account.getGlobalPrivacySettings * Get group call participants: phone.getGroupParticipants * 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 RTMP streams in a group call or livestream. : phone.getGroupCallStreamChannels * Get info about a channel/supergroup participant: channels.getParticipant * Get info about a certain wallpaper: account.getWallPaper * Get info about a chat invite: messages.getExportedChatInvite * Get info about a credit card: payments.getBankCardData * Get info about a group call: phone.getGroupCall * Get info about a stickerset: messages.getStickerSet * Get info about an emoji keyword localization: messages.getEmojiKeywordsLanguages * Get info about an unsupported deep link, see here for more info ยป: help.getDeepLinkInfo * Get info about chat invites generated by admins: messages.getAdminsWithInvites * Get info about multiple wallpapers: account.getMultiWallPapers * Get info about the chat invites of a specific chat: messages.getExportedChatInvites * Get info about the users that joined the chat using a specific chat invite: messages.getChatInviteImporters * 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 * Get installed themes: account.getThemes * Get link and embed info of a message in a channel/supergroup: channels.exportMessageLink * Get live location history of a certain user: messages.getRecentLocations * Get localization pack strings: langpack.getLangPack * Get localized emoji keywords: messages.getEmojiKeywords * Get localized name of the telegram support user: help.getSupportName * Get logged-in sessions: account.getAuthorizations * Get media autodownload settings: account.getAutoDownloadSettings * Get message ranges for saving the user's chat history: messages.getSplitRanges * Get messages in a reply thread: messages.getReplies * Get more info about a Seamless Telegram Login authorization request, for more info click here ยป: messages.requestUrlAuth * Get most used peers: contacts.getTopPeers * Get name, ISO code, localized name and phone codes/patterns of all available countries: help.getCountriesList * Get new strings in language pack: 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 recent stickers: messages.getRecentStickers * Get recently used t.me links: help.getRecentMeUrls * Get saved GIFs: messages.getSavedGifs * Get saved Telegram Passport document, for more info see the passport docs ยป: account.getSecureValue * 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 * Get temporary payment password: account.getTmpPassword * Get the admin log of a channel/supergroup: channels.getAdminLog * Get the number of results that would be found by a messages.search call with the same parameters: messages.getSearchCounters * Get the participants of a supergroup/channel: channels.getParticipants * Get theme information: account.getTheme * Get unread messages where we were mentioned: messages.getUnreadMentions * Get unread reactions to messages you sent: messages.getUnreadReactions * Get web login widget authorizations: account.getWebAuthorizations * Get which users read a specific message: only available for groups and supergroups with less than chat_read_mark_size_threshold members, read receipts will be stored for chat_read_mark_expire_period seconds after the message was sent, see client configuration for more info ยป: messages.getMessageReadParticipants * Gets current notification settings for a given user/group, from all users/all groups: account.getNotifySettings * Gets featured custom emoji stickersets: messages.getFeaturedEmojiStickers * Gets the list of currently installed custom emoji stickersets: messages.getEmojiStickers * Gets the menu button action for a given user or for all users, previously set using bots.setBotMenuButton; users can see this information in the botInfo constructor: bots.getBotMenuButton * 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 them 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 * Import a chat invite and join a private chat/supergroup/channel: messages.importChatInvite * Import chat history from a foreign chat app into a specific Telegram chat, click here for more info about imported chats ยป: messages.initHistoryImport * Imports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info: contacts.importContacts * Indicate to the server (from the user side) that the user is still using a web app: messages.prolongWebView * Informs server about a purchase made through the App Store: for official applications only: payments.assignAppStoreTransaction * Informs server about a purchase made through the Play Store: for official applications only: payments.assignPlayMarketTransaction * Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only: help.setBotUpdatesStatus * Initialize account takeout session: account.initTakeoutSession * Initialize connection: initConnection * Initiate a 2FA password reset: can only be used if the user is already logged-in, see here for more info ยป: account.resetPassword * Install wallpaper: account.installWallPaper * Install a stickerset: messages.installStickerSet * Install a theme: account.installTheme * Install/uninstall wallpaper: account.saveWallPaper * Installs a previously uploaded photo as a profile photo: photos.updateProfilePhoto * Internal use: help.editUserInfo * Internal use: help.getUserInfo * Invite a set of users to a group call: phone.inviteToGroupCall * Invite users to a channel/supergroup: channels.inviteToChannel * Invoke a method within a takeout session: invokeWithTakeout * Invoke a request without subscribing the used connection for updates (this is enabled by default for file queries): invokeWithoutUpdates * Invoke the specified query using the specified API layer: invokeWithLayer * Invoke with the given message range: invokeWithMessagesRange * Invokes a query after a successful completion of previous queries: invokeAfterMsgs * Invokes a query after successful completion of one of the previous queries: invokeAfterMsg * Join a channel/supergroup: channels.joinChannel * Join a group call: phone.joinGroupCall * Leave a channel/supergroup: channels.leaveChannel * Leave a group call: phone.leaveGroupCall * 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 using a redirected login token, generated in case of DC mismatch during QR code login: auth.importLoginToken * Look for updates of telegram's terms of service: help.getTermsOfServiceUpdate * Make a user admin in a basic group: messages.editChatAdmin * Manually mark dialog as unread: messages.markDialogUnread * Mark channel/supergroup history as read: channels.readHistory * Mark channel/supergroup message contents as read: channels.readMessageContents * Mark message reactions ยป as read: messages.readReactions * Mark a thread as read: messages.readDiscussion * Mark a specific sponsored message as read: channels.viewSponsoredMessage * Mark mentions as read: messages.readMentions * Mark new featured stickers as read: messages.readFeaturedStickers * Mark or unmark a sticker as favorite: messages.faveSticker * 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 * Notify the user that the sent passport data contains some errors The user will not be able to re-submit their Passport data to you until the errors are fixed (the contents of the field for which you returned the error must change): users.setSecureValueErrors * Obtain a list of bot commands for the specified bot scope and language code: bots.getBotCommands * Obtain available message reactions ยป: messages.getAvailableReactions * Obtain configuration for two-factor authorization with password: account.getPassword * Obtains a list of messages, indicating to which other public channels was a channel message forwarded. : stats.getMessagePublicForwards * Obtains a list of peers that can be used to send messages in a specific group: channels.getSendAs * Obtains information about a chat export file, generated by a foreign chat app, click here for more info about imported chats ยป: messages.checkHistoryImport * Once the user has confirmed their payment and shipping details, the bot receives an updateBotPrecheckoutQuery update. : messages.setBotPrecheckoutResults * Open a bot web app: messages.requestSimpleWebView * Open a bot web app, sending over user information after user confirmation: messages.requestWebView * Optional: notify the server that the user is currently busy in a call: this will automatically refuse all incoming phone calls until the current phone call is ended: phone.receivedCall * Pin a message: messages.updatePinnedMessage * Pin/unpin a dialog: messages.toggleDialogPin * Please use the event handler: channels.getMessages * Please use the event handler: messages.getHistory * Please use the event handler: messages.getMessages * Press an inline callback button and get a callback answer from the bot: messages.getBotCallbackAnswer * Query an inline bot: messages.getInlineBotResults * Rate transcribed voice message: messages.rateTranscribedAudio * Rate a call, returns info about the rating message sent to the official VoIP bot: phone.setCallRating * React to message: messages.sendReaction * Register device to receive PUSH notifications: account.registerDevice * 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 * Report a new incoming chat for spam, if the peer settings of the chat allow us to do that: messages.reportSpam * Report a peer for violation of telegram's Terms of Service: account.reportPeer * Report a profile photo of a dialog: account.reportProfilePhoto * 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 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 * Reset rating of top peer: contacts.resetTopPeerRating * 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 phone number to get user info, if their privacy settings allow it: contacts.resolvePhone * Return all message drafts. : messages.getAllDrafts * Returns a Telegram Passport authorization form for sharing data with a service: account.getAuthorizationForm * 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 attachment menu entry for a bot web app that can be launched from the attachment menu ยป: messages.getAttachMenuBot * Returns chat basic info on their IDs: messages.getChats * Returns content of a web file, by proxying the request through telegram, see the webfile docs for more info: upload.getWebFile * Returns current configuration, including data center configuration: help.getConfig * Returns found messages: messages.search * Returns info on data center nearest to the user: help.getNearestDc * Returns information about the next messages of the specified type in the chat split by days: messages.getSearchResultsCalendar * Returns information on update availability for the current application: help.getAppUpdate * Returns installed attachment menu bot web apps ยป: messages.getAttachMenuBots * Returns list of chats with non-default notification settings: account.getNotifyExceptions * Returns localized text of a text message with an invitation: help.getInviteText * Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation: messages.getSearchResultsPositions * Returns the current user dialog list: messages.getDialogs * Returns the current user's contact list: contacts.getContacts * Returns the list of blocked users: contacts.getBlocked * Returns the list of contact statuses: contacts.getStatuses * Returns the list of user photos: photos.getUserPhotos * Returns the support user for the "ask a question" feature: help.getSupport * Returns users found by username substring: contacts.search * Save a message draft associated to a chat: messages.saveDraft * Save a theme: account.saveTheme * Save or remove saved notification sound: account.saveRingtone * Save phone call debug information: phone.saveCallLog * Saves logs of application on the server: help.saveAppLog * Search for messages and peers globally: messages.searchGlobal * Search for stickersets: messages.searchStickerSets * Securely save Telegram Passport document, for more info see the passport docs ยป: account.saveSecureValue * Send VoIP signaling data: phone.sendSignalingData * Send a media: messages.sendMedia * Send a result obtained using messages.getInlineBotResults: messages.sendInlineBotResult * Send an album or grouped media: messages.sendMultiMedia * Send an email verification code: account.sendVerifyEmailCode * Send compiled payment form: payments.sendPaymentForm * 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 phone code for telegram passport: account.sendVerifyPhoneCode * Send typing event by the current user to a secret chat: messages.setEncryptedTyping * Sends a Telegram Passport authorization form, effectively sharing data with the service: account.acceptAuthorization * Sends a current user typing event (see SendMessageAction for all event types) to a conversation partner or group: messages.setTyping * 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 service message to a secret chat: messages.sendEncryptedService * Sends a text message to a secret chat: messages.sendEncrypted * Set account self-destruction period: account.setAccountTTL * Set bot command list: bots.setBotCommands * Set global privacy settings: account.setGlobalPrivacySettings * Set maximum Time-To-Live of all messages in the specified chat: messages.setHistoryTTL * 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 * Set the default suggested admin rights for bots being added as admins to channels, see here for more info on how to handle them ยป: bots.setBotBroadcastDefaultAdminRights * Set the default suggested admin rights for bots being added as admins to groups, see here for more info on how to handle them ยป: bots.setBotGroupDefaultAdminRights * Set the default peer that will be used to join a group call in a specific dialog: phone.saveDefaultGroupCallJoinAs * Set time-to-live of current session: account.setAuthorizationTTL * Set whether all users should join a discussion group in order to comment on a post ยป: channels.toggleJoinToSend * Set whether all users should request admin approval to join the group ยป: channels.toggleJoinRequest * Sets the menu button action ยป for a given user or for all users: bots.setBotMenuButton * 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 * Start a conversation with a bot using a deep linking parameter: messages.startBot * Start a scheduled group call: phone.startScheduledGroupCall * Start or stop recording a group call: the recorded audio and video streams will be automatically sent to Saved messages (the chat with ourselves): phone.toggleGroupCallRecord * Start screen sharing in a call: phone.joinGroupCallPresentation * Stop getting notifications about thread replies of a certain user in @replies: contacts.blockFromReplies * Stop screen sharing in a group call: phone.leaveGroupCallPresentation * Submit requested order information for validation: payments.validateRequestedInfo * Subscribe or unsubscribe to a scheduled group call: phone.toggleGroupCallStartSubscription * Suggests a short name for a given stickerpack name: stickers.suggestShortName * Terminate a group call: phone.discardGroupCall * Terminate webview interaction started with messages.requestWebView, sending the specified message to the chat on behalf of the user: messages.sendWebViewResultMessage * 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 * Translate a given text: messages.translateText * Turn a basic 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 * Updates user profile: account.updateProfile * Upload a file and associate it to a chat (without actually sending it to the chat): messages.uploadMedia * Upload a media file associated with an imported chat, click here for more info ยป: messages.uploadImportedMedia * Upload encrypted file and associate it to a secret chat: messages.uploadEncryptedFile * Upload notification sound, use account.saveRingtone to convert it and add it to the list of saved notification sounds: account.uploadRingtone * Upload theme: account.uploadTheme * Use this method to set the score of the specified user in a game sent as a normal message (bots only): messages.setGameScore * Use this method to set the score of the specified user in a game sent as an inline message (bots only): messages.setInlineGameScore * Use this to accept a Seamless Telegram Login authorization request, for more info click here ยป: messages.acceptUrlAuth * Used by the user to relay data from an opened reply keyboard bot web app to the bot that owns it: messages.sendWebViewData * Validates a username and checks availability: account.checkUsername * Verify a new phone number to associate to the current account: account.sendChangePhoneCode * Verify a phone number for telegram passport: account.verifyPhone * Verify an email address: account.verifyEmail * Verify an email to use as 2FA recovery method: account.confirmPasswordEmail * View and search recently sent media. : messages.searchSentMedia * 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 * Transcribe voice message: messages.transcribeAudio * Unpin all pinned messages: messages.unpinAllMessages * [Contributing](https://docs.madelineproto.xyz/docs/CONTRIB.html) * [Translation](https://docs.madelineproto.xyz/docs/CONTRIB.html#translation) * [Contribution guide](https://docs.madelineproto.xyz/docs/CONTRIB.html#contribution-guide) * [Credits](https://docs.madelineproto.xyz/docs/CONTRIB.html#credits) * [Web templates for `$MadelineProto->start()`](https://docs.madelineproto.xyz/docs/TEMPLATES.html)