Files
takopi/codex_telegram_bridge/src/codex_telegram_bridge/config.py
T
2025-12-29 02:31:54 +04:00

13 lines
338 B
Python

from __future__ import annotations
import tomllib
from pathlib import Path
from typing import Any
from .constants import TELEGRAM_CONFIG_PATH
def load_telegram_config(path: str | None = None) -> dict[str, Any]:
cfg_path = Path(path) if path else TELEGRAM_CONFIG_PATH
return tomllib.loads(cfg_path.read_text(encoding="utf-8"))