|
@@ -1,7 +1,7 @@
|
1
|
1
|
from datetime import datetime
|
2
|
2
|
from typing import Any, List
|
3
|
3
|
from uuid import uuid4
|
4
|
|
-from pydantic import BaseModel, Field, PrivateAttr, computed_field, validator
|
|
4
|
+from pydantic import BaseModel, Field, PrivateAttr, computed_field, field_validator
|
5
|
5
|
|
6
|
6
|
|
7
|
7
|
class Reaction(BaseModel):
|
|
@@ -67,7 +67,7 @@ class Message(BaseModel):
|
67
|
67
|
def item_id(self) -> str:
|
68
|
68
|
return self._id
|
69
|
69
|
|
70
|
|
- @validator("date_time", pre=True, always=True)
|
|
70
|
+ @field_validator("date_time")
|
71
|
71
|
def parse_timestamp(cls, v):
|
72
|
72
|
if isinstance(v, int):
|
73
|
73
|
return datetime.fromtimestamp(v / 1000)
|