mirror of
https://github.com/danog/MadelineProtoDocs.git
synced 2024-12-02 17:55:35 +01:00
1.9 KiB
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
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, );