Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New RPC error: IMPORT_PEER_TYPE_INVALID #4328

Open
2 tasks done
tim-ufer opened this issue Mar 14, 2024 · 1 comment
Open
2 tasks done

New RPC error: IMPORT_PEER_TYPE_INVALID #4328

tim-ufer opened this issue Mar 14, 2024 · 1 comment

Comments

@tim-ufer
Copy link

Description

Hello, I believe I have run into an undocumented RPC error while working on an API tool that would let users reimport Telegram's chat exports back into itself. To do this, I was using the foreign chat import procedure and when calling InitHistoryImportRequest, I get the following error:

telethon.errors.rpcbaseerrors.BadRequestError: RPCError 400: IMPORT_PEER_TYPE_INVALID (caused by InitHistoryImportRequest)

This specific BadRequestError is not listed in the relevant Telegram API docs, Telethon TL docs or the list of known errors spreadsheet.

I suspect that the error is caused by the chat export file being flagged as pm and the target peer being a group chat. Unfortunately, I haven't yet found a workaround for the issue so I'd welcome anyone's guess on the exact source of the error or how to get around it while importing.

Checklist

  • This is a documentation problem, not a question or a bug report.
  • I have searched for this issue before posting it and there isn't a duplicate.
@Lonami
Copy link
Member

Lonami commented Mar 15, 2024

Thanks for the detailed report. I've stopped bothering updating the errors.csv file but you're welcome to send a PR.

As for workaround or guesses, I don't have any, but I can suggest using Telegram Desktop with debugmode enable, perform the action, then check the mtp log to see how it does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants