From 3e634aa7e4f505312a25f39456cc05316d82371b Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 3 Feb 2026 07:02:59 -0800 Subject: [PATCH] Update requirements and enhance environment variable loading in gateway - Updated requirements.txt to uncomment and ensure the installation of `python-telegram-bot` and `discord.py` packages. - Enhanced the gateway run script to load environment variables from a specified path, improving configuration management and flexibility for different environments. --- gateway/run.py | 8 ++++++++ requirements.txt | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gateway/run.py b/gateway/run.py index dfa97c457..9c354ebd4 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -24,6 +24,14 @@ from typing import Dict, Optional, Any, List # Add parent directory to path sys.path.insert(0, str(Path(__file__).parent.parent)) +# Load environment variables from ~/.hermes/.env +from dotenv import load_dotenv +_env_path = Path.home() / '.hermes' / '.env' +if _env_path.exists(): + load_dotenv(_env_path) +# Also try project .env as fallback +load_dotenv() + from gateway.config import ( Platform, GatewayConfig, diff --git a/requirements.txt b/requirements.txt index 68a31e447..98db357c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,10 +35,10 @@ croniter # Optional: For messaging platform integrations (gateway) # Telegram: pip install python-telegram-bot -# python-telegram-bot>=20.0 +python-telegram-bot>=20.0 # Discord: pip install discord.py -# discord.py>=2.0 +discord.py>=2.0 # WhatsApp: Requires Node.js bridge (see docs/messaging.md) # aiohttp # For WhatsApp bridge communication \ No newline at end of file