Load .env file at startup via python-dotenv
Running directly with `python -m gaming_deals_bot` didn't pick up variables from .env — only the Docker path (--env-file) did. Now dotenv is loaded before config parsing so both workflows work. https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX
This commit is contained in:
@@ -6,6 +6,7 @@ import signal
|
||||
import sys
|
||||
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from .bot import DealsBot
|
||||
from .config import Config
|
||||
@@ -21,6 +22,7 @@ def setup_logging():
|
||||
|
||||
|
||||
async def main():
|
||||
load_dotenv()
|
||||
setup_logging()
|
||||
logger = logging.getLogger("gaming_deals_bot")
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@ httpx>=0.25.0
|
||||
aiosqlite>=0.19.0
|
||||
apscheduler>=3.10.0
|
||||
markdown>=3.5.0
|
||||
python-dotenv>=1.0.0
|
||||
|
||||
Reference in New Issue
Block a user