devops
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2025-09-11 08:02:35 +09:00
parent 398729a4a0
commit fcf27c1639
13 changed files with 585 additions and 297 deletions

View File

@@ -1,29 +1,33 @@
import os
from dataclasses import dataclass, field
from typing import List
from dotenv import load_dotenv
load_dotenv()
def get_admin_ids() -> List[int]:
admin_str = os.getenv("ADMIN_IDS", "")
if admin_str:
return [int(x) for x in admin_str.split(",") if x.strip()]
return []
@dataclass
class Config:
bot_token: str = os.getenv("BOT_TOKEN", "")
admin_ids: List[int] = field(default_factory=get_admin_ids)
database_path: str = os.getenv("DATABASE_PATH", "data/quiz_bot.db")
csv_data_path: str = os.getenv("CSV_DATA_PATH", "data/")
# Настройки викторины
questions_per_quiz: int = int(os.getenv("QUESTIONS_PER_QUIZ", "10"))
time_per_question: int = int(os.getenv("TIME_PER_QUESTION", "30"))
# Режимы работы
guest_mode_enabled: bool = os.getenv("GUEST_MODE_ENABLED", "true").lower() == "true"
test_mode_enabled: bool = os.getenv("TEST_MODE_ENABLED", "true").lower() == "true"
config = Config()