Method: messages.initHistoryImport
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 userbots use this method: YES
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, );