WIP: Refactor Aurora (3.0.0) #29
1 changed files with 8 additions and 0 deletions
|
@ -68,3 +68,11 @@ class Moderation(BaseModel):
|
|||
return cls(**case)
|
||||
|
||||
return None
|
||||
|
||||
class JSONEncoder(json.JSONEncoder):
|
||||
def default(self, o):
|
||||
if isinstance(o, datetime):
|
||||
return o.timestamp()
|
||||
if isinstance(o, timedelta):
|
||||
return str(o)
|
||||
return super().default(o)
|
||||
|
|
Loading…
Reference in a new issue