58 lines
1.3 KiB
Python
58 lines
1.3 KiB
Python
import os
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""
|
|
Settings class that defines configuration variables for the application.
|
|
|
|
Attributes:
|
|
----------
|
|
app_env : str
|
|
Specifies the environment in which the application is running.
|
|
Default is 'DEV'. Possible values could include 'DEV', 'PROD'
|
|
|
|
workers : int
|
|
Defines the number of workers to be used in the application.
|
|
Default is 1.
|
|
|
|
api_id : int
|
|
Represents the API ID from my.telegram.org
|
|
|
|
api_hash : str
|
|
The hash key corresponding to your API Hash from my.telegram.org
|
|
|
|
bot_token : str
|
|
The token from BotFather.
|
|
|
|
storage : os.path
|
|
Specifies the path where the application stores persistent data.
|
|
|
|
allowed_ids : str
|
|
A list or comma-separated string of IDs that are allowed access
|
|
to the bot or application.
|
|
|
|
log_level : str
|
|
The log level used for logging module.
|
|
|
|
Config:
|
|
-------
|
|
env_file : str
|
|
Specifies the environment file to load the environment variables from.
|
|
Default is ".env".
|
|
"""
|
|
app_env: str = "DEV"
|
|
workers: int = 1
|
|
api_id: int
|
|
api_hash: str
|
|
bot_token: str
|
|
storage: os.path
|
|
allowed_ids: str
|
|
log_level: str
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|