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.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user