Closed Rongronggg9 closed 2 years ago
Thanks for the detailed report. Version 2 of the library will offer dynamic errors, so this won't be an issue. This is probably not actionable in v1 because there can't be two classes with the same name (one matching a number and one not).
@Lonami
Version 2 of the library will offer dynamic errors
Wow, that's awesome! May I ask about the schedule for releasing v2?
I have plans to keep on working on it in January, but no specific release date.
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip
and triggered the bug in the latest version. (this RPC error is really hard to reproduce in my use case, and nothing related to this issue has changed since v1.24.0...)Code that causes the issue
Traceback
Notes
The error seems to only occur when sending an album. And the number represents which media caused this error, I guess (because I observed that this number can be any number less than the amount of media in the album).
It is hard to reproduce this error in my use case. I wrote an RSS bot that sends media using their URLs (
InputMediaPhotoExternal
/InputMediaDocumentExternal
), instead of downloading them then uploading them. In logs, I found this error several times. However, I could not reproduce it even if I tried to make the bot send exactly the same messages! The error is not listed in the possible errors of messages.sendMultiMedia, and according to the doc from Telegram, the error seems shouldn't occur when sending media as external URLs (because Telegram is the one that will fetch media and send, and there should not be any too long delay betweenUploadMediaRequest
andSendMultiMediaRequest
). Do I misunderstand or not? The error itself is not really a problem for me because I can always resend the media in other ways though.The problem is, the error
FILE_REFERENCE_\d_EXPIRED
is not converted to aFileReferenceExpiredError
, which makes catching it with ease impossible. (catching it in other complicated ways is possible though) In telethon_generator/data/errors.csv (L138), onlyFILE_REFERENCE_EXPIRED
is contained:Thus in telethon/errors/__init__.py (L28),
FILE_REFERENCE_\d_EXPIRED
cannot be converted because nothing matched:IDK if this error should be converted by design, maybe it's not only a bug report but also a feature request? :)