From 7c01ecaf601e9c8de3111f06e08f27e765e086e7 Mon Sep 17 00:00:00 2001 From: zhilv Date: Fri, 1 May 2026 22:29:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(conf):=20=E4=BF=AE=E5=A4=8D=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=AF=BB=E5=8F=96=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 5 +++++ pyproject.toml | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index 186eddf..43b492a 100644 --- a/config.py +++ b/config.py @@ -4,6 +4,11 @@ import os import uuid from pathlib import Path +from dotenv import load_dotenv + +# 加载 .env 文件(优先从插件目录查找) +load_dotenv(Path(__file__).parent / ".env") + # ── 鉴权 ──────────────────────────────────────────────────── WEBHOOK_API_KEY: str = os.environ.get("WEBHOOK_API_KEY", "") or uuid.uuid4().hex diff --git a/pyproject.toml b/pyproject.toml index 682585d..15737d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [project] -name = "ncatbot-demo" -version = "0.1.0" -description = "NcatBot webhook plugin – receive external messages and forward to QQ" +name = "Webhook Plugin" +version = "0.1.1" +description = "将发消息的接口代理出来" readme = "README.md" requires-python = ">=3.12" dependencies = [ "ncatbot5>=5.5.2.post3", "aiohttp>=3.9", + "python-dotenv>=1.0", ]