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: 227

  • 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
├── peer → InputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── file → InputFile
│ ├── InputFile
│ │ ├── id → long
│ │ ├── parts → int
│ │ ├── name → string
│ │ └── md5_checksum → string
│ ├── InputFileBig
│ │ ├── id → long
│ │ ├── parts → int
│ │ └── name → string
│ └── id → InputDocument
│ ├── InputDocumentEmpty
│ └── InputDocument
│ ├── id → long
│ ├── access_hash → long
│ └── file_reference → bytes
└── media_count → int

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,
    )
)