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
+20
View File
@@ -0,0 +1,20 @@
from sqlalchemy import Column, Integer, String, BigInteger, DateTime, UniqueConstraint
from datetime import datetime
from infra.db.postgres import Base
class FootballSubscription(Base):
__tablename__ = "football_subscriptions"
id = Column(Integer, primary_key=True, index=True)
guild_id = Column(BigInteger, nullable=False, index=True)
channel_id = Column(BigInteger, nullable=False)
team_name = Column(String, nullable=False) # Storing name for easier user interaction/display, or mapped ID later
team_id = Column(Integer, nullable=True) # Optional: Store API ID for reliability
created_at = Column(DateTime, default=datetime.now)
__table_args__ = (
UniqueConstraint('guild_id', 'team_name', name='uix_guild_team'),
)
def __repr__(self):
return f"<FootballSubscription(guild_id={self.guild_id}, team={self.team_name})>"