修复webhook url指定

This commit is contained in:
2025-10-29 12:14:50 +08:00
parent d36bb2de83
commit c80fb67165
2 changed files with 12 additions and 13 deletions

View File

@@ -9,15 +9,20 @@ load_dotenv()
# 项目根目录
BASE_DIR = Path(__file__).resolve().parent
def get_webhook_url():
"""动态获取Webhook URL"""
return os.getenv(
# WPS Webhook配置 - 使用函数动态获取
WEBHOOK_URL = os.getenv(
"WEBHOOK_URL",
"https://xz.wps.cn/api/v1/webhook/send?key=da86927e491f2aef4b964223687c2c80"
)
# WPS Webhook配置 - 使用函数动态获取
WEBHOOK_URL = get_webhook_url()
def SetWebhookURL(url: str):
"""设置Webhook URL"""
global WEBHOOK_URL
WEBHOOK_URL = url
def GetWebhookURL() -> str:
"""获取Webhook URL"""
return WEBHOOK_URL
# 数据库配置
DATABASE_PATH = os.getenv("DATABASE_PATH", str(BASE_DIR / "data" / "bot.db"))