MadelineProtoDocs/docs/API_docs/methods/messages.initHistoryImport.md
2024-05-01 14:53:46 +02:00

1.9 KiB

title description grand_parent parent image redirect_from
messages.initHistoryImport Import chat history from a foreign chat app into a specific Telegram chat, [click here for more info about imported chats »](https://core.telegram.org/api/import). Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/messages_initHistoryImport.html

Method: messages.initHistoryImport

Back to methods index

Import chat history from a foreign chat app into a specific Telegram chat, click here for more info about imported chats ».

Parameters:

Name Type Description Required
peer Username, chat ID, Update, Message or InputPeer The Telegram chat where the history should be imported. Optional
file File path or InputFile File with messages to import. Yes
media_count int Number of media files associated with the chat that will be uploaded using messages.uploadImportedMedia. Optional

Return type: messages.HistoryImport

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

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();

$messages_HistoryImport = $MadelineProto->messages->initHistoryImport(peer: $InputPeer, file: $InputFile, media_count: $int, );