messages.InitHistoryImport

class pyrogram.raw.functions.messages.InitHistoryImport

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

Details:
  • Layer: 223

  • ID: 34090C3B

Parameters:
  • peer (InputPeer) – The Telegram chat where the history should be imported.

  • file (InputFile) – File with messages to import.

  • media_count (int 32-bit) – Number of media files associated with the chat that will be uploaded using messages.uploadImportedMedia.

Returns:

messages.HistoryImport

TL Schema

messages.initHistoryImport#34090c3b
peer:InputPeer
file:InputFile
media_count:int

= messages.HistoryImport

Parameter Tree

InitHistoryImport
├── peerInputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_idlong
│ ├── InputPeerUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ ├── InputPeerChannel
│ │ ├── channel_idlong
│ │ └── access_hashlong
│ │ ├── peerInputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_idint
│ │ └── user_idlong
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── channel_idlong
├── fileInputFile
│ ├── InputFile
│ │ ├── idlong
│ │ ├── partsint
│ │ ├── namestring
│ │ └── md5_checksumstring
│ ├── InputFileBig
│ │ ├── idlong
│ │ ├── partsint
│ │ └── namestring
│ └── idInputDocument
│ ├── InputDocumentEmpty
│ └── InputDocument
│ ├── idlong
│ ├── access_hashlong
│ └── file_referencebytes
└── media_countint

Example

await app.invoke(
    InitHistoryImport(
        peer=await app.resolve_peer(chat_id),
        file=InputFile(
            id=0,
            parts=0,
            name="text",
            md5_checksum="text"
        ),
        media_count=0,
    )
)