mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-06 07:14:50 +00:00
Add namespaces when printing Object types
This commit is contained in:
parent
c22cf3d89a
commit
c88ca2e4f5
1 changed files with 5 additions and 2 deletions
|
|
@ -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 a new issue