telegram api method · layer 229 · #34090c3b
messages.initHistoryImport
Import chat history from a foreign chat app into a specific Telegram chat, click here for more info about imported chats ».
definition
messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport;
parameters
| name | type | description |
|---|---|---|
peer | InputPeer | The Telegram chat where the history should be imported. |
file | InputFile | File with messages to import. |
media_count | int | Number of media files associated with the chat that will be uploaded using messages.uploadImportedMedia. |
returns
errors (9)
| code | error | description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection. |
| 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. |
| 400 | USER_NOT_MUTUAL_CONTACT | The provided user is not a mutual contact. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
| 406 | PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_%dMIN | Import for this chat is already in progress, wait %d minutes before starting a new one. |
history
present in layers 123–229
| id | layers |
|---|---|
| #34090c3b | 123–229 |