28 lines
599 B
Python
28 lines
599 B
Python
from functools import lru_cache
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
bot_token: str = ""
|
|
webhook_url: str = ""
|
|
webhook_path: str = "/webhook/telegram"
|
|
webhook_secret: str = ""
|
|
|
|
database_url: str = "postgresql+asyncpg://postgres:postgres@postgres:5432/tglotterybot"
|
|
|
|
mini_app_url: str = ""
|
|
|
|
avatar_cache_ttl: int = 3600
|
|
|
|
debug: bool = False
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
return Settings()
|
|
|
|
|
|
settings = get_settings()
|