init_history_import()

async Client.init_history_import()

Initialize a chat history import.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – The chat to import the history into.

  • file (InputFile) – The uploaded history export file.

  • media_count (int) – Number of media files to be imported.

Returns:

HistoryImport – The history import session.

Example

session = await app.init_history_import(chat_id, file=uploaded_file, media_count=5)