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
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

View File

@@ -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",
]