mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-02 15:25:41 +00:00
Use __name__ instead of .split(".")[-1]
This commit is contained in:
@@ -72,11 +72,12 @@ class Encoder(JSONEncoder):
|
|||||||
else:
|
else:
|
||||||
return repr(o)
|
return repr(o)
|
||||||
|
|
||||||
|
name = o.__class__.__name__
|
||||||
o = objects.get(getattr(o, "ID", None), None)
|
o = objects.get(getattr(o, "ID", None), None)
|
||||||
|
|
||||||
if o is not None:
|
if o is not None:
|
||||||
if o.startswith("pyrogram.client"):
|
if o.startswith("pyrogram.client"):
|
||||||
r = remove_none(OrderedDict([("_", o.split(".")[-1])] + [i for i in content.items()]))
|
r = remove_none(OrderedDict([("_", name)] + [i for i in content.items()]))
|
||||||
r.pop("client", None)
|
r.pop("client", None)
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
Reference in New Issue
Block a user