feat: Tái cấu trúc bot sang kiến trúc cog, thêm hỗ trợ đa máy chủ, giới thiệu tính năng đăng ký bóng đá, giao diện web và quản lý cấu hình.

This commit is contained in:
2026-01-16 17:26:42 +07:00
parent 8c38357c28
commit b24365927a
39 changed files with 3864 additions and 997 deletions
+9 -4
View File
@@ -1,14 +1,19 @@
from sqlalchemy import Column, Integer, BigInteger, String
from infra.db.base import Base
from sqlalchemy import Column, Integer, BigInteger, String, UniqueConstraint
from infra.db.base import Base, TimestampMixin
class Score(Base):
class Score(Base, TimestampMixin):
__tablename__ = "score"
id = Column(Integer, primary_key=True, autoincrement=True)
user_id = Column(BigInteger, nullable=False, unique=True)
guild_id = Column(BigInteger, nullable=False, default=0)
user_id = Column(BigInteger, nullable=False)
user_name = Column(String(255), nullable=True)
point = Column(Integer, nullable=False, default=0)
__table_args__ = (
UniqueConstraint('guild_id', 'user_id', name='uq_score_guild_user'),
)
def __str__(self):
return f"ID: {self.id}, User ID: {self.user_id}, User Name: {self.user_name}, point: {self.point}"