fix(conf): 修复无法读取配置文件

This commit is contained in:
2026-05-01 22:29:34 +08:00
parent 55ae431d10
commit 7c01ecaf60
2 changed files with 9 additions and 3 deletions

View File

@@ -4,6 +4,11 @@ import os
import uuid import uuid
from pathlib import Path 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 WEBHOOK_API_KEY: str = os.environ.get("WEBHOOK_API_KEY", "") or uuid.uuid4().hex

View File

@@ -1,10 +1,11 @@
[project] [project]
name = "ncatbot-demo" name = "Webhook Plugin"
version = "0.1.0" version = "0.1.1"
description = "NcatBot webhook plugin receive external messages and forward to QQ" description = "将发消息的接口代理出来"
readme = "README.md" readme = "README.md"
requires-python = ">=3.12" requires-python = ">=3.12"
dependencies = [ dependencies = [
"ncatbot5>=5.5.2.post3", "ncatbot5>=5.5.2.post3",
"aiohttp>=3.9", "aiohttp>=3.9",
"python-dotenv>=1.0",
] ]