Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add _type to all Telegram API objects in ndjson (#368)
* Add "_type" to *all* telethon.tl.types objects in ndjson Previously SearchTelegram.serialize_obj would only add the "_type" tag to the JSON object representing a TLObject if that object was an immediate child property of another TLObject - other cases would not add the _type, in particular - where a TLObject has a property whose value is a *list* of other TLObjects, the members of the list would not have a _type in the JSON - this is most noticeable for things like Message.entities, Page.blocks, etc. - the initial object passed in to serialize_obj did not have a _type added * Removed some redundant if branches. - 'if type(value).__module__[0:8] == "telethon"' is subsumed by 'if type(value) not in scalars and value is not None' - 'if type(value) is dict' is unreachable since dict is not in scalars, so the loop will already have continue-d at the previous condition
- Loading branch information