Change structure of default processor

This commit is contained in:
taizan-hokouto
2020-10-24 19:12:00 +09:00
parent 4905b1e4d8
commit 3200c5654f
9 changed files with 257 additions and 154 deletions

View File

@@ -0,0 +1,11 @@
import json
from .renderer.base import Author
from .renderer.paidmessage import Colors
from .renderer.paidsticker import Colors2
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, Author) or isinstance(obj, Colors) or isinstance(obj, Colors2):
return vars(obj)
return json.JSONEncoder.default(self, obj)