This commit is contained in:
2023-08-06 14:05:34 +02:00
parent 217adb85ed
commit 2f1fdecd5f
21 changed files with 273 additions and 1053 deletions

View File

@@ -1,16 +1,19 @@
from datetime import datetime
import enum
from typing import TypedDict
from pydantic import BaseModel, constr
from pydantic import BaseModel
class CreateUploadedFile(BaseModel):
backend: constr(max_length=16) # type: ignore
data: dict
upload_time: datetime
class UploadBackend(enum.StrEnum):
bot = "bot"
user = "user"
class Data(TypedDict):
chat_id: str | int
message_id: int
class UploadedFile(BaseModel):
id: int
backend: str
data: dict
upload_time: datetime
backend: UploadBackend
data: Data