27 lines
691 B
Python
27 lines
691 B
Python
import json
|
|
import os
|
|
from typing import Any
|
|
|
|
CONFIG_DIR = os.getenv("CONFIG_DIR", "/config")
|
|
CONFIG_FILE = os.getenv("CONFIG_FILE", "harborforge.json")
|
|
|
|
|
|
def load_runtime_config() -> dict[str, Any]:
|
|
config_path = os.path.join(CONFIG_DIR, CONFIG_FILE)
|
|
if not os.path.exists(config_path):
|
|
return {}
|
|
try:
|
|
with open(config_path, "r") as f:
|
|
return json.load(f)
|
|
except Exception:
|
|
return {}
|
|
|
|
|
|
def get_discord_wakeup_config() -> dict[str, str | None]:
|
|
cfg = load_runtime_config()
|
|
discord_cfg = cfg.get("discord") or {}
|
|
return {
|
|
"guild_id": discord_cfg.get("guild_id"),
|
|
"bot_token": discord_cfg.get("bot_token"),
|
|
}
|