Support-BOT

This commit is contained in:
2024-05-01 19:55:22 +03:00
commit 4280385d32
34 changed files with 1361 additions and 0 deletions

17
app/models/user.py Normal file
View File

@@ -0,0 +1,17 @@
from sqlalchemy import BigInteger, String, Boolean
from sqlalchemy.orm import mapped_column, relationship
from app.core.db import Base
class User(Base):
"""Модель пользователя телеграм"""
telegram_id = mapped_column(BigInteger, unique=True, nullable=False)
telegram_username = mapped_column(String(100), nullable=True)
is_banned = mapped_column(Boolean, default=False)
first_name = mapped_column(String(100), nullable=True)
last_name = mapped_column(String(100), nullable=True)
is_admin = mapped_column(Boolean, default=False)
# messages = relationship('Message', backref='telegram_user',
# foreign_keys=[telegram_id])