Link
Search
Menu
Expand
Document
⭐️ 1.8k
🌞
🌚
⭐️ on GitHub!
MadelineProto
Creating a client
Login
Features
Requirements
Installation
Broadcasting messages to all users
Handling updates (new messages & other events)
Database
Settings
Getting info about the current user
Exceptions
Avoiding FLOOD_WAITs
Logging
Telegram VoIP phone calls
Uploading and downloading files
Getting info about chats
Getting all chats (dialogs)
Inline buttons
Secret chats
Using a proxy
Async
Using methods
Contributing
Web templates for `$MadelineProto->start()`
MadelineProto API
danog\MadelineProto\API: Main API wrapper for MadelineProto.
danog\MadelineProto\AsyncTools: Async tools.
danog\MadelineProto\Broadcast\Action: Interface that represents a broadcast action.
danog\MadelineProto\Broadcast\Filter: Broadcast filter.
danog\MadelineProto\Broadcast\Progress: Broadcast progress.
danog\MadelineProto\Broadcast\Status: Broadcast status.
danog\MadelineProto\Coroutine: Creates a promise from a generator function yielding promises.
danog\MadelineProto\Db\DbArray: DB array interface.
danog\MadelineProto\Db\DbPropertiesFactory: This factory class initializes the correct database backend for MadelineProto.
danog\MadelineProto\Db\DbPropertiesTrait: Include this trait and call DbPropertiesTrait::initDb to use MadelineProto's database backend for properties.
danog\MadelineProto\Db\DriverArray: Array caching trait.
danog\MadelineProto\Db\MemoryArray: Memory database backend.
danog\MadelineProto\Db\MysqlArray: MySQL database backend.
danog\MadelineProto\Db\PostgresArray: Postgres database backend.
danog\MadelineProto\Db\RedisArray: Redis database backend.
danog\MadelineProto\Db\SqlArray: Generic SQL database backend.
danog\MadelineProto\DoHWrapper:
danog\MadelineProto\EventHandler: Event handler.
danog\MadelineProto\Exception: Basic exception.
danog\MadelineProto\FileCallback: File callback interface.
danog\MadelineProto\FileCallbackInterface: File callback interface.
danog\MadelineProto\Files\Server: MadelineProto fileserver.
danog\MadelineProto\Logger: Logger class.
danog\MadelineProto\Lua: Lua interface.
danog\MadelineProto\MTProtoTools\ResponseInfo: Obtain response information for file to server.
danog\MadelineProto\MyTelegramOrgWrapper: Wrapper for my.telegram.org.
danog\MadelineProto\PTSException: Internal error indicating a problem with Telegram's servers.
danog\MadelineProto\PsrLogger: PSR-3 wrapper for MadelineProto's Logger.
danog\MadelineProto\RPCErrorException: Indicates an error returned by Telegram's API.
danog\MadelineProto\RPCError\FloodWaitError: Represents a FLOOD_WAIT_ RPC error returned by telegram.
danog\MadelineProto\ResponseException: Indicates an error thrown when an unexpected response is received from telegram's servers.
danog\MadelineProto\SecurityException: Indicates a security error.
danog\MadelineProto\Settings: Settings class used for configuring MadelineProto.
danog\MadelineProto\Settings\AppInfo: App information.
danog\MadelineProto\Settings\Auth: Cryptography settings.
danog\MadelineProto\Settings\Connection: Connection settings.
danog\MadelineProto\Settings\DatabaseAbstract: Base class for storage backends.
danog\MadelineProto\Settings\Database\DatabaseAbstract: Base class for database backends.
danog\MadelineProto\Settings\Database\DriverDatabaseAbstract: Base class for database backends.
danog\MadelineProto\Settings\Database\Memory: Memory backend settings.
danog\MadelineProto\Settings\Database\Mysql: MySQL backend settings.
danog\MadelineProto\Settings\Database\Postgres: Postgres backend settings.
danog\MadelineProto\Settings\Database\Redis: Redis backend settings.
danog\MadelineProto\Settings\Database\SqlAbstract: Generic db backend settings.
danog\MadelineProto\Settings\Files: File management settings.
danog\MadelineProto\Settings\Ipc: IPC server settings.
danog\MadelineProto\Settings\Logger: Logger settings.
danog\MadelineProto\Settings\Peer: Peer database settings.
danog\MadelineProto\Settings\Pwr: PWRTelegram settings.
danog\MadelineProto\Settings\RPC: RPC settings.
danog\MadelineProto\Settings\SecretChats: Secret chat settings.
danog\MadelineProto\Settings\Serialization: Serialization settings.
danog\MadelineProto\Settings\TLSchema: TL schema settings.
danog\MadelineProto\Settings\Templates: Web and CLI template settings for login.
danog\MadelineProto\Settings\VoIP: VoIP settings.
danog\MadelineProto\Shutdown: Class that controls script shutdown.
danog\MadelineProto\StrTools: Some tools.
danog\MadelineProto\TL\Conversion\Entities: Entities module.
danog\MadelineProto\TL\Conversion\Exception: TL conversion exception.
danog\MadelineProto\TL\Conversion\Extension: Manages generation of extensions for files.
danog\MadelineProto\TL\Exception: TL deserialization exception.
danog\MadelineProto\TL\Types\Button: Clickable button.
danog\MadelineProto\TL\Types\Bytes: Bytes wrapper.
danog\MadelineProto\TON\API: TON API.
danog\MadelineProto\Tools: Some tools.
danog\MadelineProto\VoIPServerConfig: Manages storage of VoIP server config.
Telegram RPC API
Methods
account.acceptAuthorization
account.cancelPasswordEmail
account.changeAuthorizationSettings
account.changePhone
account.checkUsername
account.clearRecentEmojiStatuses
account.confirmPasswordEmail
account.confirmPhone
account.createTheme
account.declinePasswordReset
account.deleteAccount
account.deleteAutoSaveExceptions
account.deleteSecureValue
account.finishTakeoutSession
account.getAccountTTL
account.getAllSecureValues
account.getAuthorizationForm
account.getAuthorizations
account.getAutoDownloadSettings
account.getAutoSaveSettings
account.getChatThemes
account.getContactSignUpNotification
account.getContentSettings
account.getDefaultEmojiStatuses
account.getDefaultGroupPhotoEmojis
account.getDefaultProfilePhotoEmojis
account.getGlobalPrivacySettings
account.getMultiWallPapers
account.getNotifyExceptions
account.getNotifySettings
account.getPassword
account.getPasswordSettings
account.getPrivacy
account.getRecentEmojiStatuses
account.getSavedRingtones
account.getSecureValue
account.getTheme
account.getThemes
account.getTmpPassword
account.getWallPaper
account.getWallPapers
account.getWebAuthorizations
account.initTakeoutSession
account.installTheme
account.installWallPaper
account.registerDevice
account.reorderUsernames
account.reportPeer
account.reportProfilePhoto
account.resendPasswordEmail
account.resetAuthorization
account.resetNotifySettings
account.resetPassword
account.resetWallPapers
account.resetWebAuthorization
account.resetWebAuthorizations
account.saveAutoDownloadSettings
account.saveAutoSaveSettings
account.saveRingtone
account.saveSecureValue
account.saveTheme
account.saveWallPaper
account.sendChangePhoneCode
account.sendConfirmPhoneCode
account.sendVerifyEmailCode
account.sendVerifyPhoneCode
account.setAccountTTL
account.setAuthorizationTTL
account.setContactSignUpNotification
account.setContentSettings
account.setGlobalPrivacySettings
account.setPrivacy
account.toggleUsername
account.unregisterDevice
account.updateDeviceLocked
account.updateEmojiStatus
account.updateNotifySettings
account.updatePasswordSettings
account.updateProfile
account.updateStatus
account.updateTheme
account.updateUsername
account.uploadRingtone
account.uploadTheme
account.uploadWallPaper
account.verifyEmail
account.verifyPhone
auth.acceptLoginToken
auth.bindTempAuthKey
auth.cancelCode
auth.checkPassword
auth.checkRecoveryPassword
auth.dropTempAuthKeys
auth.exportAuthorization
auth.exportLoginToken
auth.importAuthorization
auth.importBotAuthorization
auth.importLoginToken
auth.importWebTokenAuthorization
auth.logOut
auth.recoverPassword
auth.requestFirebaseSms
auth.requestPasswordRecovery
auth.resendCode
auth.resetAuthorizations
auth.resetLoginEmail
auth.sendCode
auth.signIn
auth.signUp
botLogin
bots.answerWebhookJSONQuery
bots.getBotCommands
bots.getBotInfo
bots.getBotMenuButton
bots.reorderUsernames
bots.resetBotCommands
bots.sendCustomRequest
bots.setBotBroadcastDefaultAdminRights
bots.setBotCommands
bots.setBotGroupDefaultAdminRights
bots.setBotInfo
bots.setBotMenuButton
bots.toggleUsername
channels.checkUsername
channels.convertToGigagroup
channels.createChannel
channels.createForumTopic
channels.deactivateAllUsernames
channels.deleteChannel
channels.deleteHistory
channels.deleteMessages
channels.deleteParticipantHistory
channels.deleteTopicHistory
channels.editAdmin
channels.editBanned
channels.editCreator
channels.editForumTopic
channels.editLocation
channels.editPhoto
channels.editTitle
channels.exportMessageLink
channels.getAdminLog
channels.getAdminedPublicChannels
channels.getChannels
channels.getForumTopics
channels.getForumTopicsByID
channels.getFullChannel
channels.getGroupsForDiscussion
channels.getInactiveChannels
channels.getLeftChannels
channels.getMessages
channels.getParticipant
channels.getParticipants
channels.getSendAs
channels.getSponsoredMessages
channels.inviteToChannel
channels.joinChannel
channels.leaveChannel
channels.readHistory
channels.readMessageContents
channels.reorderPinnedForumTopics
channels.reorderUsernames
channels.reportAntiSpamFalsePositive
channels.reportSpam
channels.setDiscussionGroup
channels.setStickers
channels.toggleAntiSpam
channels.toggleForum
channels.toggleJoinRequest
channels.toggleJoinToSend
channels.toggleParticipantsHidden
channels.togglePreHistoryHidden
channels.toggleSignatures
channels.toggleSlowMode
channels.toggleUsername
channels.updatePinnedForumTopic
channels.updateUsername
channels.viewSponsoredMessage
chatlists.checkChatlistInvite
chatlists.deleteExportedInvite
chatlists.editExportedInvite
chatlists.exportChatlistInvite
chatlists.getChatlistUpdates
chatlists.getExportedInvites
chatlists.getLeaveChatlistSuggestions
chatlists.hideChatlistUpdates
chatlists.joinChatlistInvite
chatlists.joinChatlistUpdates
chatlists.leaveChatlist
complete2falogin
completePhoneLogin
completeSignup
contacts.acceptContact
contacts.addContact
contacts.block
contacts.blockFromReplies
contacts.deleteByPhones
contacts.deleteContacts
contacts.exportContactToken
contacts.getBlocked
contacts.getContactIDs
contacts.getContacts
contacts.getLocated
contacts.getSaved
contacts.getStatuses
contacts.getTopPeers
contacts.importContactToken
contacts.importContacts
contacts.resetSaved
contacts.resetTopPeerRating
contacts.resolvePhone
contacts.resolveUsername
contacts.search
contacts.toggleTopPeers
contacts.unblock
folders.editPeerFolders
getDialogs
getFullDialogs
getFullInfo
getId
getInfo
getPwrChat
getSelf
help.acceptTermsOfService
help.dismissSuggestion
help.editUserInfo
help.getAppChangelog
help.getAppConfig
help.getAppUpdate
help.getCdnConfig
help.getConfig
help.getCountriesList
help.getDeepLinkInfo
help.getInviteText
help.getNearestDc
help.getPassportConfig
help.getPremiumPromo
help.getPromoData
help.getRecentMeUrls
help.getSupport
help.getSupportName
help.getTermsOfServiceUpdate
help.getUserInfo
help.hidePromoData
help.saveAppLog
help.setBotUpdatesStatus
initConnection
invokeAfterMsg
invokeAfterMsgs
invokeWithLayer
invokeWithMessagesRange
invokeWithTakeout
invokeWithoutUpdates
langpack.getDifference
langpack.getLangPack
langpack.getLanguage
langpack.getLanguages
langpack.getStrings
messages.acceptEncryption
messages.acceptUrlAuth
messages.addChatUser
messages.checkChatInvite
messages.checkHistoryImport
messages.checkHistoryImportPeer
messages.clearAllDrafts
messages.clearRecentReactions
messages.clearRecentStickers
messages.createChat
messages.deleteChat
messages.deleteChatUser
messages.deleteExportedChatInvite
messages.deleteHistory
messages.deleteMessages
messages.deletePhoneCallHistory
messages.deleteRevokedExportedChatInvites
messages.deleteScheduledMessages
messages.discardEncryption
messages.editChatAbout
messages.editChatAdmin
messages.editChatDefaultBannedRights
messages.editChatPhoto
messages.editChatTitle
messages.editExportedChatInvite
messages.editInlineBotMessage
messages.editMessage
messages.exportChatInvite
messages.faveSticker
messages.forwardMessages
messages.getAdminsWithInvites
messages.getAllDrafts
messages.getAllStickers
messages.getArchivedStickers
messages.getAttachMenuBot
messages.getAttachMenuBots
messages.getAttachedStickers
messages.getAvailableReactions
messages.getBotApp
messages.getBotCallbackAnswer
messages.getChatInviteImporters
messages.getChats
messages.getCommonChats
messages.getCustomEmojiDocuments
messages.getDefaultHistoryTTL
messages.getDhConfig
messages.getDialogFilters
messages.getDialogUnreadMarks
messages.getDialogs
messages.getDiscussionMessage
messages.getDocumentByHash
messages.getEmojiGroups
messages.getEmojiKeywords
messages.getEmojiKeywordsDifference
messages.getEmojiKeywordsLanguages
messages.getEmojiProfilePhotoGroups
messages.getEmojiStatusGroups
messages.getEmojiStickers
messages.getEmojiURL
messages.getExportedChatInvite
messages.getExportedChatInvites
messages.getExtendedMedia
messages.getFavedStickers
messages.getFeaturedEmojiStickers
messages.getFeaturedStickers
messages.getFullChat
messages.getGameHighScores
messages.getHistory
messages.getInlineBotResults
messages.getInlineGameHighScores
messages.getMaskStickers
messages.getMessageEditData
messages.getMessageReactionsList
messages.getMessageReadParticipants
messages.getMessages
messages.getMessagesReactions
messages.getMessagesViews
messages.getOldFeaturedStickers
messages.getOnlines
messages.getPeerDialogs
messages.getPeerSettings
messages.getPinnedDialogs
messages.getPollResults
messages.getPollVotes
messages.getRecentLocations
messages.getRecentReactions
messages.getRecentStickers
messages.getReplies
messages.getSavedGifs
messages.getScheduledHistory
messages.getScheduledMessages
messages.getSearchCounters
messages.getSearchResultsCalendar
messages.getSearchResultsPositions
messages.getSplitRanges
messages.getStickerSet
messages.getStickers
messages.getSuggestedDialogFilters
messages.getTopReactions
messages.getUnreadMentions
messages.getUnreadReactions
messages.getWebPage
messages.getWebPagePreview
messages.hideAllChatJoinRequests
messages.hideChatJoinRequest
messages.hidePeerSettingsBar
messages.importChatInvite
messages.initHistoryImport
messages.installStickerSet
messages.markDialogUnread
messages.migrateChat
messages.prolongWebView
messages.rateTranscribedAudio
messages.readDiscussion
messages.readEncryptedHistory
messages.readFeaturedStickers
messages.readHistory
messages.readMentions
messages.readMessageContents
messages.readReactions
messages.receivedMessages
messages.receivedQueue
messages.reorderPinnedDialogs
messages.reorderStickerSets
messages.report
messages.reportEncryptedSpam
messages.reportReaction
messages.reportSpam
messages.requestAppWebView
messages.requestEncryption
messages.requestSimpleWebView
messages.requestUrlAuth
messages.requestWebView
messages.saveDefaultSendAs
messages.saveDraft
messages.saveGif
messages.saveRecentSticker
messages.search
messages.searchCustomEmoji
messages.searchGlobal
messages.searchSentMedia
messages.searchStickerSets
messages.sendBotRequestedPeer
messages.sendEncrypted
messages.sendEncryptedFile
messages.sendEncryptedService
messages.sendInlineBotResult
messages.sendMedia
messages.sendMessage
messages.sendMultiMedia
messages.sendReaction
messages.sendScheduledMessages
messages.sendScreenshotNotification
messages.sendVote
messages.sendWebViewData
messages.sendWebViewResultMessage
messages.setBotCallbackAnswer
messages.setBotPrecheckoutResults
messages.setBotShippingResults
messages.setChatAvailableReactions
messages.setChatTheme
messages.setChatWallPaper
messages.setDefaultHistoryTTL
messages.setDefaultReaction
messages.setEncryptedTyping
messages.setGameScore
messages.setHistoryTTL
messages.setInlineBotResults
messages.setInlineGameScore
messages.setTyping
messages.startBot
messages.startHistoryImport
messages.toggleBotInAttachMenu
messages.toggleDialogPin
messages.toggleNoForwards
messages.togglePeerTranslations
messages.toggleStickerSets
messages.transcribeAudio
messages.translateText
messages.uninstallStickerSet
messages.unpinAllMessages
messages.updateDialogFilter
messages.updateDialogFiltersOrder
messages.updatePinnedMessage
messages.uploadEncryptedFile
messages.uploadImportedMedia
messages.uploadMedia
payments.assignAppStoreTransaction
payments.assignPlayMarketTransaction
payments.canPurchasePremium
payments.clearSavedInfo
payments.exportInvoice
payments.getBankCardData
payments.getPaymentForm
payments.getPaymentReceipt
payments.getSavedInfo
payments.sendPaymentForm
payments.validateRequestedInfo
phone.acceptCall
phone.checkGroupCall
phone.confirmCall
phone.createGroupCall
phone.discardCall
phone.discardGroupCall
phone.editGroupCallParticipant
phone.editGroupCallTitle
phone.exportGroupCallInvite
phone.getCallConfig
phone.getGroupCall
phone.getGroupCallJoinAs
phone.getGroupCallStreamChannels
phone.getGroupCallStreamRtmpUrl
phone.getGroupParticipants
phone.inviteToGroupCall
phone.joinGroupCall
phone.joinGroupCallPresentation
phone.leaveGroupCall
phone.leaveGroupCallPresentation
phone.receivedCall
phone.requestCall
phone.saveCallDebug
phone.saveCallLog
phone.saveDefaultGroupCallJoinAs
phone.sendSignalingData
phone.setCallRating
phone.startScheduledGroupCall
phone.toggleGroupCallRecord
phone.toggleGroupCallSettings
phone.toggleGroupCallStartSubscription
phoneLogin
photos.deletePhotos
photos.getUserPhotos
photos.updateProfilePhoto
photos.uploadContactProfilePhoto
photos.uploadProfilePhoto
requestCall
requestSecretChat
stats.getBroadcastStats
stats.getMegagroupStats
stats.getMessagePublicForwards
stats.getMessageStats
stats.loadAsyncGraph
stickers.addStickerToSet
stickers.changeSticker
stickers.changeStickerPosition
stickers.checkShortName
stickers.createStickerSet
stickers.deleteStickerSet
stickers.removeStickerFromSet
stickers.renameStickerSet
stickers.setStickerSetThumb
stickers.suggestShortName
update2fa
updates.getChannelDifference
updates.getDifference
updates.getState
upload.getCdnFile
upload.getCdnFileHashes
upload.getFile
upload.getFileHashes
upload.getWebFile
upload.reuploadCdnFile
upload.saveBigFilePart
upload.saveFilePart
users.getFullUser
users.getUsers
users.setSecureValueErrors
Telegram RPC API
Methods
getDialogs
Method: getDialogs
Gets full list of dialogs
Return type: Array of
Peer objects
Example (
now fully async!
):
$Peers
=
$MadelineProto
->
getDialogs
();