BIG refactoring

This commit is contained in:
vvzvlad
2025-02-02 18:51:50 +03:00
parent 172100f821
commit f360f1167c
7 changed files with 494 additions and 157 deletions
+9 -17
View File
@@ -1,22 +1,14 @@
import os
TG_API_ID = int(os.getenv("TG_API_ID"))
TG_API_HASH = os.getenv("TG_API_HASH")
SESSION_PATH = os.getenv("SESSION_PATH", "session.file") or "session.file"
API_HOST = os.getenv("API_HOST", "0.0.0.0")
API_PORT = int(os.getenv("API_PORT") or 8000)
REQUEST_TIMEOUT = int(os.getenv("REQUEST_TIMEOUT") or 30)
SESSION_STRING = os.getenv("TG_SESSION_STRING", "")
def get_settings():
return {
"tg_api_id": TG_API_ID,
"tg_api_hash": TG_API_HASH,
"session_path": SESSION_PATH,
"api_host": API_HOST,
"api_port": API_PORT,
"request_timeout": REQUEST_TIMEOUT,
"session_string": SESSION_STRING,
"tg_api_id": int(os.getenv("TG_API_ID")),
"tg_api_hash": os.getenv("TG_API_HASH"),
"session_path": os.getenv("SESSION_PATH", "session.file") or "session.file",
"api_host": os.getenv("API_HOST", "0.0.0.0"),
"api_port": int(os.getenv("API_PORT") or 8000),
"session_string": os.getenv("TG_SESSION_STRING", ""),
"pyrogram_bridge_url": os.getenv("PYROGRAM_BRIDGE_URL", ""),
"log_level": os.getenv("LOG_LEVEL", "INFO")
}
"log_level": os.getenv("LOG_LEVEL", "INFO"),
"debug": os.getenv("DEBUG", "False") == "True"
}