mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
Add namespaces when printing Object types
This commit is contained in:
parent
c22cf3d89a
commit
c88ca2e4f5
@ -77,11 +77,14 @@ class Encoder(JSONEncoder):
|
|||||||
|
|
||||||
if o is not None:
|
if o is not None:
|
||||||
if o.startswith("pyrogram.client"):
|
if o.startswith("pyrogram.client"):
|
||||||
r = remove_none(OrderedDict([("_", name)] + [i for i in content.items()]))
|
r = remove_none(OrderedDict([("_", "pyrogram:" + name)] + [i for i in content.items()]))
|
||||||
r.pop("_client", None)
|
r.pop("_client", None)
|
||||||
|
|
||||||
return r
|
return r
|
||||||
else:
|
else:
|
||||||
return OrderedDict([("_", o)] + [i for i in content.items()])
|
return OrderedDict(
|
||||||
|
[("_", o.replace("pyrogram.api.types.", "telegram:"))]
|
||||||
|
+ [i for i in content.items()]
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user