mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Remove Client objects representation
This commit is contained in:
parent
dcbce9f9a1
commit
739779c29d
@ -72,10 +72,15 @@ class Encoder(JSONEncoder):
|
|||||||
else:
|
else:
|
||||||
return repr(o)
|
return repr(o)
|
||||||
|
|
||||||
if objects.get(getattr(o, "ID", "")).startswith("pyrogram.client"):
|
o = objects.get(getattr(o, "ID", None), None)
|
||||||
return remove_none(OrderedDict([i for i in content.items()]))
|
|
||||||
|
if o is not None:
|
||||||
|
if o.startswith("pyrogram.client"):
|
||||||
|
r = remove_none(OrderedDict([i for i in content.items()]))
|
||||||
|
r.pop("client", None)
|
||||||
|
|
||||||
|
return r
|
||||||
|
else:
|
||||||
|
return OrderedDict([("_", o)] + [i for i in content.items()])
|
||||||
else:
|
else:
|
||||||
return OrderedDict(
|
return None
|
||||||
[("_", objects.get(getattr(o, "ID", None), None))]
|
|
||||||
+ [i for i in content.items()]
|
|
||||||
)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user