telegram api method · layer 229 · #34090c3b

messages.initHistoryImport

usable by users

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

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.

returns

messages.HistoryImport

errors (9)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis 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.
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.
400USER_NOT_MUTUAL_CONTACTThe provided user is not a mutual contact.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
406PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_%dMINImport for this chat is already in progress, wait %d minutes before starting a new one.

history

present in layers 123–229

idlayers
#34090c3b123–229