* Documentation rework * Apply fixes from StyleCI * Documentation fixes * Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite * Apply fixes from StyleCI * Logging fixes * Build docs * Add methods to modify start template, bugfix to logging and keyboard conversion * Add TL documentator * Document MTProto methods * Documenting methods... * 7% documented * Bugfixes * Update docs * Update docs * Simplify file management * Implement automatic object conversion for media, and more awesome stuff * Implement automatic object conversion for media, and more awesome stuff * Implement event update handler and file upload/download callback * Auto-detect mime type, duration, width and height of media * Update docs * Document new file functions * Fix links * Fix links * Update bot.php to use event loop * Implement webhook update handler and forking in main loop * Build docs * Better docs * Fixes to secret chats * Almost finished updating docs * Bugfixes, implemented infinite loop for loop() method, almost finished docs * Finish writing docs * Add automatic documentation builder script * Finished writing docs
40 KiB
title | description |
---|---|
Methods | List of methods |
Methods
Back to API documentation index
$MadelineProto->logout();
$MadelineProto->phone_login($number);
$MadelineProto->complete_phone_login($code);
$MadelineProto->complete_2FA_login($password);
$MadelineProto->bot_login($token);
$MadelineProto->get_dialogs();
$MadelineProto->get_pwr_chat($id);
$MadelineProto->get_info($id);
$MadelineProto->get_full_info($id);
$MadelineProto->get_self();
$MadelineProto->request_call($id);
$MadelineProto->request_secret_chat($id);
$MadelineProto->account->changePhone(['phone_number' => string, 'phone_code_hash' => string, 'phone_code' => string, ]) === $User
$MadelineProto->account->checkUsername(['username' => string, ]) === $Bool
$MadelineProto->account->deleteAccount(['reason' => string, ]) === $Bool
$MadelineProto->account->getAccountTTL([]) === $AccountDaysTTL
$MadelineProto->account->getAuthorizations([]) === $account_Authorizations
$MadelineProto->account->getNotifySettings(['peer' => InputNotifyPeer, ]) === $PeerNotifySettings
$MadelineProto->account->getPassword([]) === $account_Password
$MadelineProto->account->getPasswordSettings(['current_password_hash' => bytes, ]) === $account_PasswordSettings
$MadelineProto->account->getPrivacy(['key' => InputPrivacyKey, ]) === $account_PrivacyRules
$MadelineProto->account->getWallPapers([]) === $Vector_of_WallPaper
$MadelineProto->account->registerDevice(['token_type' => int, 'token' => string, 'device_model' => string, 'system_version' => string, 'app_version' => string, 'app_sandbox' => Bool, 'lang_code' => string, ]) === $Bool
$MadelineProto->account->reportPeer(['peer' => InputPeer, 'reason' => ReportReason, ]) === $Bool
$MadelineProto->account->resetAuthorization(['hash' => long, ]) === $Bool
$MadelineProto->account->resetNotifySettings([]) === $Bool
$MadelineProto->account->sendChangePhoneCode(['phone_number' => string, ]) === $account_SentChangePhoneCode
$MadelineProto->account->setAccountTTL(['ttl' => AccountDaysTTL, ]) === $Bool
$MadelineProto->account->setPrivacy(['key' => InputPrivacyKey, 'rules' => [InputPrivacyRule], ]) === $account_PrivacyRules
$MadelineProto->account->unregisterDevice(['token_type' => int, 'token' => string, ]) === $Bool
$MadelineProto->account->updateDeviceLocked(['period' => int, ]) === $Bool
$MadelineProto->account->updateNotifySettings(['peer' => InputNotifyPeer, 'settings' => InputPeerNotifySettings, ]) === $Bool
$MadelineProto->account->updatePasswordSettings(['current_password_hash' => bytes, 'new_settings' => account_PasswordInputSettings, ]) === $Bool
$MadelineProto->account->updateProfile(['first_name' => string, 'last_name' => string, ]) === $User
$MadelineProto->account->updateStatus(['offline' => Bool, ]) === $Bool
$MadelineProto->account->updateUsername(['username' => string, ]) === $User
$MadelineProto->auth->bindTempAuthKey(['perm_auth_key_id' => long, 'nonce' => long, 'expires_at' => int, 'encrypted_message' => bytes, ]) === $Bool
$MadelineProto->auth->checkPassword(['password_hash' => bytes, ]) === $auth_Authorization
$MadelineProto->auth->checkPhone(['phone_number' => string, ]) === $auth_CheckedPhone
$MadelineProto->auth->exportAuthorization(['dc_id' => int, ]) === $auth_ExportedAuthorization
$MadelineProto->auth->importAuthorization(['id' => int, 'bytes' => bytes, ]) === $auth_Authorization
$MadelineProto->auth->importBotAuthorization(['api_id' => int, 'api_hash' => string, 'bot_auth_token' => string, ]) === $auth_Authorization
$MadelineProto->auth->logOut([]) === $Bool
$MadelineProto->auth->recoverPassword(['code' => string, ]) === $auth_Authorization
$MadelineProto->auth->requestPasswordRecovery([]) === $auth_PasswordRecovery
$MadelineProto->auth->resetAuthorizations([]) === $Bool
$MadelineProto->auth->sendCall(['phone_number' => string, 'phone_code_hash' => string, ]) === $Bool
$MadelineProto->auth->sendCode(['phone_number' => string, 'sms_type' => int, 'api_id' => int, 'api_hash' => string, 'lang_code' => string, ]) === $auth_SentCode
$MadelineProto->auth->sendInvites(['phone_numbers' => [string], 'message' => string, ]) === $Bool
$MadelineProto->auth->sendSms(['phone_number' => string, 'phone_code_hash' => string, ]) === $Bool
$MadelineProto->auth->signIn(['phone_number' => string, 'phone_code_hash' => string, 'phone_code' => string, ]) === $auth_Authorization
$MadelineProto->auth->signUp(['phone_number' => string, 'phone_code_hash' => string, 'phone_code' => string, 'first_name' => string, 'last_name' => string, ]) === $auth_Authorization
$MadelineProto->channels->checkUsername(['channel' => InputChannel, 'username' => string, ]) === $Bool
$MadelineProto->channels->createChannel(['broadcast' => Bool, 'megagroup' => Bool, 'title' => string, 'about' => string, ]) === $Updates
$MadelineProto->channels->deleteChannel(['channel' => InputChannel, ]) === $Updates
$MadelineProto->channels->deleteMessages(['channel' => InputChannel, 'id' => [int], ]) === $messages_AffectedMessages
$MadelineProto->channels->deleteUserHistory(['channel' => InputChannel, 'user_id' => InputUser, ]) === $messages_AffectedHistory
$MadelineProto->channels->editAbout(['channel' => InputChannel, 'about' => string, ]) === $Bool
$MadelineProto->channels->editAdmin(['channel' => InputChannel, 'user_id' => InputUser, 'role' => ChannelParticipantRole, ]) === $Updates
$MadelineProto->channels->editPhoto(['channel' => InputChannel, 'photo' => InputChatPhoto, ]) === $Updates
$MadelineProto->channels->editTitle(['channel' => InputChannel, 'title' => string, ]) === $Updates
$MadelineProto->channels->exportInvite(['channel' => InputChannel, ]) === $ExportedChatInvite
$MadelineProto->channels->getChannels(['id' => [InputChannel], ]) === $messages_Chats
$MadelineProto->channels->getDialogs(['offset' => int, 'limit' => int, ]) === $messages_Dialogs
$MadelineProto->channels->getFullChannel(['channel' => InputChannel, ]) === $messages_ChatFull
$MadelineProto->channels->getImportantHistory(['channel' => InputChannel, 'offset_id' => int, 'add_offset' => int, 'limit' => int, 'max_id' => int, 'min_id' => int, ]) === $messages_Messages
$MadelineProto->channels->getMessages(['channel' => InputChannel, 'id' => [int], ]) === $messages_Messages
$MadelineProto->channels->getParticipant(['channel' => InputChannel, 'user_id' => InputUser, ]) === $channels_ChannelParticipant
$MadelineProto->channels->getParticipants(['channel' => InputChannel, 'filter' => ChannelParticipantsFilter, 'offset' => int, 'limit' => int, ]) === $channels_ChannelParticipants
$MadelineProto->channels->inviteToChannel(['channel' => InputChannel, 'users' => [InputUser], ]) === $Updates
$MadelineProto->channels->joinChannel(['channel' => InputChannel, ]) === $Updates
$MadelineProto->channels->kickFromChannel(['channel' => InputChannel, 'user_id' => InputUser, 'kicked' => Bool, ]) === $Updates
$MadelineProto->channels->leaveChannel(['channel' => InputChannel, ]) === $Updates
$MadelineProto->channels->readHistory(['channel' => InputChannel, 'max_id' => int, ]) === $Bool
$MadelineProto->channels->reportSpam(['channel' => InputChannel, 'user_id' => InputUser, 'id' => [int], ]) === $Bool
$MadelineProto->channels->toggleComments(['channel' => InputChannel, 'enabled' => Bool, ]) === $Updates
$MadelineProto->channels->updateUsername(['channel' => InputChannel, 'username' => string, ]) === $Bool
$MadelineProto->contacts->block(['id' => InputUser, ]) === $Bool
$MadelineProto->contacts->deleteContact(['id' => InputUser, ]) === $contacts_Link
$MadelineProto->contacts->deleteContacts(['id' => [InputUser], ]) === $Bool
$MadelineProto->contacts->exportCard([]) === $Vector_of_int
$MadelineProto->contacts->getBlocked(['offset' => int, 'limit' => int, ]) === $contacts_Blocked
$MadelineProto->contacts->getContacts(['hash' => string, ]) === $contacts_Contacts
$MadelineProto->contacts->getStatuses([]) === $Vector_of_ContactStatus
$MadelineProto->contacts->getSuggested(['limit' => int, ]) === $contacts_Suggested
$MadelineProto->contacts->importCard(['export_card' => [int], ]) === $User
$MadelineProto->contacts->importContacts(['contacts' => [InputContact], 'replace' => Bool, ]) === $contacts_ImportedContacts
$MadelineProto->contacts->resolveUsername(['username' => string, ]) === $contacts_ResolvedPeer
$MadelineProto->contacts->search(['q' => string, 'limit' => int, ]) === $contacts_Found
$MadelineProto->contacts->unblock(['id' => InputUser, ]) === $Bool
$MadelineProto->help->getAppChangelog(['device_model' => string, 'system_version' => string, 'app_version' => string, 'lang_code' => string, ]) === $help_AppChangelog
$MadelineProto->help->getAppUpdate(['device_model' => string, 'system_version' => string, 'app_version' => string, 'lang_code' => string, ]) === $help_AppUpdate
$MadelineProto->help->getConfig([]) === $Config
$MadelineProto->help->getInviteText(['lang_code' => string, ]) === $help_InviteText
$MadelineProto->help->getNearestDc([]) === $NearestDc
$MadelineProto->help->getSupport([]) === $help_Support
$MadelineProto->help->getTermsOfService(['lang_code' => string, ]) === $help_TermsOfService
$MadelineProto->help->saveAppLog(['events' => [InputAppEvent], ]) === $Bool
$MadelineProto->initConnection(['api_id' => int, 'device_model' => string, 'system_version' => string, 'app_version' => string, 'lang_code' => string, 'query' => !X, ]) === $X
$MadelineProto->invokeAfterMsg(['msg_id' => long, 'query' => !X, ]) === $X
$MadelineProto->invokeAfterMsgs(['msg_ids' => [long], 'query' => !X, ]) === $X
$MadelineProto->invokeWithLayer(['layer' => int, 'query' => !X, ]) === $X
$MadelineProto->invokeWithoutUpdates(['query' => !X, ]) === $X
$MadelineProto->messages->acceptEncryption(['peer' => InputEncryptedChat, 'g_b' => bytes, 'key_fingerprint' => long, ]) === $EncryptedChat
$MadelineProto->messages->addChatUser(['chat_id' => InputPeer, 'user_id' => InputUser, 'fwd_limit' => int, ]) === $Updates
$MadelineProto->messages->checkChatInvite(['hash' => string, ]) === $ChatInvite
$MadelineProto->messages->createChat(['users' => [InputUser], 'title' => string, ]) === $Updates
$MadelineProto->messages->deleteChatUser(['chat_id' => InputPeer, 'user_id' => InputUser, ]) === $Updates
$MadelineProto->messages->deleteHistory(['peer' => InputPeer, 'max_id' => int, ]) === $messages_AffectedHistory
$MadelineProto->messages->deleteMessages(['id' => [int], ]) === $messages_AffectedMessages
$MadelineProto->messages->discardEncryption(['chat_id' => int, ]) === $Bool
$MadelineProto->messages->editChatAdmin(['chat_id' => InputPeer, 'user_id' => InputUser, 'is_admin' => Bool, ]) === $Bool
$MadelineProto->messages->editChatPhoto(['chat_id' => InputPeer, 'photo' => InputChatPhoto, ]) === $Updates
$MadelineProto->messages->editChatTitle(['chat_id' => InputPeer, 'title' => string, ]) === $Updates
$MadelineProto->messages->exportChatInvite(['chat_id' => InputPeer, ]) === $ExportedChatInvite
$MadelineProto->messages->forwardMessage(['peer' => InputPeer, 'id' => int, ]) === $Updates
$MadelineProto->messages->forwardMessages(['broadcast' => Bool, 'from_peer' => InputPeer, 'id' => [int], 'to_peer' => InputPeer, ]) === $Updates
$MadelineProto->messages->getAllStickers(['hash' => int, ]) === $messages_AllStickers
$MadelineProto->messages->getChats(['id' => [int], ]) === $messages_Chats
$MadelineProto->messages->getDhConfig(['version' => int, 'random_length' => int, ]) === $messages_DhConfig
$MadelineProto->messages->getDialogs(['offset_date' => int, 'offset_id' => int, 'offset_peer' => InputPeer, 'limit' => int, ]) === $messages_Dialogs
$MadelineProto->messages->getDocumentByHash(['sha256' => bytes, 'size' => int, 'mime_type' => string, ]) === $Document
$MadelineProto->messages->getFullChat(['chat_id' => InputPeer, ]) === $messages_ChatFull
$MadelineProto->messages->getHistory(['peer' => InputPeer, 'offset_id' => int, 'add_offset' => int, 'limit' => int, 'max_id' => int, 'min_id' => int, ]) === $messages_Messages
$MadelineProto->messages->getInlineBotResults(['bot' => InputUser, 'query' => string, 'offset' => string, ]) === $messages_BotResults
$MadelineProto->messages->getMessages(['id' => [int], ]) === $messages_Messages
$MadelineProto->messages->getMessagesViews(['peer' => InputPeer, 'id' => [int], 'increment' => Bool, ]) === $Vector_of_int
$MadelineProto->messages->getSavedGifs(['hash' => int, ]) === $messages_SavedGifs
$MadelineProto->messages->getStickerSet(['stickerset' => InputStickerSet, ]) === $messages_StickerSet
$MadelineProto->messages->getStickers(['emoticon' => string, 'hash' => string, ]) === $messages_Stickers
$MadelineProto->messages->getWebPagePreview(['message' => string, ]) === $MessageMedia
$MadelineProto->messages->importChatInvite(['hash' => string, ]) === $Updates
$MadelineProto->messages->installStickerSet(['stickerset' => InputStickerSet, 'disabled' => Bool, ]) === $Bool
$MadelineProto->messages->migrateChat(['chat_id' => InputPeer, ]) === $Updates
$MadelineProto->messages->readEncryptedHistory(['peer' => InputEncryptedChat, 'max_date' => int, ]) === $Bool
$MadelineProto->messages->readHistory(['peer' => InputPeer, 'max_id' => int, ]) === $messages_AffectedMessages
$MadelineProto->messages->readMessageContents(['id' => [int], ]) === $messages_AffectedMessages
$MadelineProto->messages->receivedMessages(['max_id' => int, ]) === $Vector_of_ReceivedNotifyMessage
$MadelineProto->messages->receivedQueue(['max_qts' => int, ]) === $Vector_of_long
$MadelineProto->messages->reorderStickerSets(['order' => [long], ]) === $Bool
$MadelineProto->messages->reportSpam(['peer' => InputPeer, ]) === $Bool
$MadelineProto->messages->requestEncryption(['user_id' => InputUser, 'g_a' => bytes, ]) === $EncryptedChat
$MadelineProto->messages->saveGif(['id' => InputDocument, 'unsave' => Bool, ]) === $Bool
$MadelineProto->messages->search(['important_only' => Bool, 'peer' => InputPeer, 'q' => string, 'filter' => MessagesFilter, 'min_date' => int, 'max_date' => int, 'offset' => int, 'max_id' => int, 'limit' => int, ]) === $messages_Messages
$MadelineProto->messages->searchGifs(['q' => string, 'offset' => int, ]) === $messages_FoundGifs
$MadelineProto->messages->searchGlobal(['q' => string, 'offset_date' => int, 'offset_peer' => InputPeer, 'offset_id' => int, 'limit' => int, ]) === $messages_Messages
$MadelineProto->messages->sendBroadcast(['contacts' => [InputUser], 'message' => string, 'media' => InputMedia, ]) === $Updates
$MadelineProto->messages->sendEncrypted(['peer' => InputEncryptedChat, 'message' => DecryptedMessage, ]) === $messages_SentEncryptedMessage
$MadelineProto->messages->sendEncryptedFile(['peer' => InputEncryptedChat, 'message' => DecryptedMessage, 'file' => InputEncryptedFile, ]) === $messages_SentEncryptedMessage
$MadelineProto->messages->sendEncryptedService(['peer' => InputEncryptedChat, 'message' => DecryptedMessage, ]) === $messages_SentEncryptedMessage
$MadelineProto->messages->sendInlineBotResult(['broadcast' => Bool, 'peer' => InputPeer, 'reply_to_msg_id' => int, 'query_id' => long, 'id' => string, ]) === $Updates
$MadelineProto->messages->sendMedia(['broadcast' => Bool, 'peer' => InputPeer, 'reply_to_msg_id' => int, 'media' => InputMedia, 'reply_markup' => ReplyMarkup, ]) === $Updates
$MadelineProto->messages->sendMessage(['no_webpage' => Bool, 'broadcast' => Bool, 'peer' => InputPeer, 'reply_to_msg_id' => int, 'message' => string, 'reply_markup' => ReplyMarkup, 'entities' => [MessageEntity], ]) === $Updates
$MadelineProto->messages->setEncryptedTyping(['peer' => InputEncryptedChat, 'typing' => Bool, ]) === $Bool
$MadelineProto->messages->setInlineBotResults(['gallery' => Bool, 'private' => Bool, 'query_id' => long, 'results' => [InputBotInlineResult], 'cache_time' => int, 'next_offset' => string, ]) === $Bool
$MadelineProto->messages->setTyping(['peer' => InputPeer, 'action' => SendMessageAction, ]) === $Bool
$MadelineProto->messages->startBot(['bot' => InputUser, 'peer' => InputPeer, 'start_param' => string, ]) === $Updates
$MadelineProto->messages->toggleChatAdmins(['chat_id' => InputPeer, 'enabled' => Bool, ]) === $Updates
$MadelineProto->messages->uninstallStickerSet(['stickerset' => InputStickerSet, ]) === $Bool
$MadelineProto->photos->deletePhotos(['id' => [InputPhoto], ]) === $Vector_of_long
$MadelineProto->photos->getUserPhotos(['user_id' => InputUser, 'offset' => int, 'max_id' => long, 'limit' => int, ]) === $photos_Photos
$MadelineProto->photos->updateProfilePhoto(['id' => InputPhoto, 'crop' => InputPhotoCrop, ]) === $UserProfilePhoto
$MadelineProto->photos->uploadProfilePhoto(['file' => InputFile, 'caption' => string, 'geo_point' => InputGeoPoint, 'crop' => InputPhotoCrop, ]) === $photos_Photo
$MadelineProto->updates->getChannelDifference(['channel' => InputChannel, 'filter' => ChannelMessagesFilter, 'pts' => int, 'limit' => int, ]) === $updates_ChannelDifference
$MadelineProto->updates->getDifference(['pts' => int, 'date' => int, 'qts' => int, ]) === $updates_Difference
$MadelineProto->updates->getState([]) === $updates_State
$MadelineProto->upload->getFile(['location' => InputFileLocation, 'offset' => int, 'limit' => int, ]) === $upload_File
$MadelineProto->upload->saveBigFilePart(['file_id' => long, 'file_part' => int, 'file_total_parts' => int, 'bytes' => bytes, ]) === $Bool
$MadelineProto->upload->saveFilePart(['file_id' => long, 'file_part' => int, 'bytes' => bytes, ]) === $Bool
$MadelineProto->users->getFullUser(['id' => InputUser, ]) === $UserFull
$MadelineProto->users->getUsers(['id' => [InputUser], ]) === $Vector_of_User