in there..
I guess I could check that resp.file.media.CONSTRUCTOR_ID == "0xfb197a65" instead of the isinstance check, but that seems a bit unnecessary.
Sounds like you're suggesting polymorphism and overriding methods?
You said the default _bytes() methods for those objects would be unwise because excess data, right?
there is no significant diff for sending, you just needs two fields anyways i was commenting on that, if you didn't want to make manual serilizer stuff, don't use from_reader, tgread_object will know the type from first 4 bytes like now, form InputPhoto/Document, and bytes() it, store that. you can also bytes the media object itself in case you want to download it. file_id is optional, or even slower than using TL stuff
Обсуждают сегодня