diff options
Diffstat (limited to 'models/announcement.py')
| -rw-r--r-- | models/announcement.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/models/announcement.py b/models/announcement.py new file mode 100644 index 0000000..5f752d7 --- /dev/null +++ b/models/announcement.py | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | from aiogram.types import MessageEntity | ||
| 2 | from pydantic import BaseModel | ||
| 3 | from sqlalchemy import JSON | ||
| 4 | from sqlalchemy.orm import Mapped, mapped_column | ||
| 5 | |||
| 6 | from models import BaseTable | ||
| 7 | |||
| 8 | |||
| 9 | class Message(BaseModel): | ||
| 10 | text: str | ||
| 11 | entities: list[MessageEntity] = [] | ||
| 12 | |||
| 13 | |||
| 14 | class Announcement(BaseTable): | ||
| 15 | __tablename__ = "announcement" | ||
| 16 | |||
| 17 | id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True) | ||
| 18 | message: Mapped[str] = mapped_column(JSON()) | ||
