feat: Integrate Telegram bot with polling for owner commands

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-01-21 11:41:13 -07:00
parent ccaf5869bf
commit 9c70e47232
2 changed files with 69 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ class Settings:
chunked_uploads_enabled: bool = False
chunk_size_mb: int = 95
timezone: str = "UTC"
telegram_bot_api_key: str = ""
telegram_bot_owner_id: str = ""
def _hash_password(pw: str) -> str:
"""Return PBKDF2-SHA256 hash of a password."""
@@ -74,6 +76,8 @@ def load_settings() -> Settings:
except ValueError:
chunk_size_mb = 95
timezone = os.getenv("TIMEZONE", "UTC")
telegram_bot_api_key = os.getenv("TELEGRAM_BOT_API_KEY", "")
telegram_bot_owner_id = os.getenv("TELEGRAM_BOT_OWNER_ID", "")
return Settings(
admin_password=admin_password,
max_concurrent=maxc,
@@ -85,4 +89,6 @@ def load_settings() -> Settings:
chunked_uploads_enabled=chunked_uploads_enabled,
chunk_size_mb=chunk_size_mb,
timezone=timezone,
telegram_bot_api_key=telegram_bot_api_key,
telegram_bot_owner_id=telegram_bot_owner_id,
)