From 3138fe314f5535e3695cd0ea7b5b83f2a8787e26 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Feb 2026 02:04:37 +0000 Subject: [PATCH] Load .env file at startup via python-dotenv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gaming_deals_bot/__main__.py | 2 ++ requirements.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/gaming_deals_bot/__main__.py b/gaming_deals_bot/__main__.py index 0e2762d..c6dd4e4 100644 --- a/gaming_deals_bot/__main__.py +++ b/gaming_deals_bot/__main__.py @@ -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") diff --git a/requirements.txt b/requirements.txt index fc96547..f8562a2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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