Layer 220
MessagesInitHistoryImport
Import chat history from a foreign chat app into a specific Telegram chat, click here for more info about imported chats.
method
Users
messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport;
Parameters
Returns
messages.HistoryImportPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 400 | IMPORT_FILE_INVALID | The specified chat export file is invalid. |
| 400 | IMPORT_FORMAT_DATE_INVALID | The date specified in the import file is invalid. |
| 400 | IMPORT_FORMAT_UNRECOGNIZED | The specified chat export file was exported from an unsupported chat app. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 406 | PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_%dMIN | Import for this chat is already in progress, wait <number> minutes before starting a new one. |
Gogram Example
// MessagesInitHistoryImport - positional arguments result, err := client.MessagesInitHistoryImport(&tg.InputPeerUser{UserID: int64(123456789)}, &tg.InputFile{ID: int64(0), Parts: 1, Name: "file.dat"}, 0) if err != nil { // handle error } // result is *tg.MessagesHistoryImport