29 lines
901 B
Python
29 lines
901 B
Python
from pydantic import BaseModel
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
from .notifications import NotificationsSettings
|
|
from .repositories import RepositorySettings
|
|
from .telegram_bot.polling import TelegramBotPollingSettings
|
|
from .telegram_bot.webhook import TelegramBotWebhookSettings
|
|
|
|
|
|
class LoggingSettings(BaseModel):
|
|
level: str = "INFO"
|
|
format: str = "{time}|{level:>8}|{message}"
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(
|
|
env_prefix="BIRTHDAY_POOL_BOT__",
|
|
env_nested_delimiter="__",
|
|
extra="ignore",
|
|
)
|
|
|
|
logging: LoggingSettings = LoggingSettings()
|
|
repository: RepositorySettings = RepositorySettings()
|
|
telegram_bot: (
|
|
TelegramBotPollingSettings |
|
|
TelegramBotWebhookSettings
|
|
) = TelegramBotPollingSettings()
|
|
notifications: NotificationsSettings = NotificationsSettings()
|