Files
beaver_project/app-instance/backend/nanobot/config/paths.py
2026-03-13 16:40:08 +08:00

20 lines
551 B
Python

"""Path helpers shared by config and channel integrations."""
from pathlib import Path
from nanobot.config.loader import get_data_dir as _get_data_dir
def get_data_dir() -> Path:
"""Return the global nanobot data directory (~/.nanobot)."""
return _get_data_dir()
def get_media_dir(channel: str | None = None) -> Path:
"""Return the media directory, optionally namespaced by channel."""
base = get_data_dir() / "media"
if channel:
base = base / str(channel)
base.mkdir(parents=True, exist_ok=True)
return base