messages.initHistoryImport #

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

Layer 223

messages.historyImport#1662af0b id:long = messages.HistoryImport;
---functions---
messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport;

Parameters #

NameTypeDescription
peerInputPeerThe Telegram chat where the history should be imported.
fileInputFileFile with messages to import.
media_countintNumber of media files associated with the chat that will be uploaded using messages.uploadImportedMedia.

Result #

messages.HistoryImport

Only users can use this method #

Possible errors #

CodeTypeDescription
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400IMPORT_FILE_INVALIDThe specified chat export file is invalid.
400IMPORT_FORMAT_DATE_INVALIDThe date specified in the import file is invalid.
400IMPORT_FORMAT_UNRECOGNIZEDThe specified chat export file was exported from an unsupported chat app.
400PEER_ID_INVALIDThe provided peer id is invalid.
406PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_%dMINImport for this chat is already in progress, wait %d minutes before starting a new one.
400USER_NOT_MUTUAL_CONTACTThe provided user is not a mutual contact.

Imported messages #

Telegram allows importing messages and media from foreign chat apps.

messages.uploadImportedMedia #

Upload a media file associated with an imported chat, click here for more info ».