mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 06:14:51 +00:00
Use __name__ instead of .split(".")[-1]
This commit is contained in:
parent
f29b8bb7e4
commit
3d3c1e2c0e
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue