修复webhook url指定无效的问题

This commit is contained in:
2025-10-29 12:11:28 +08:00
parent 38e81dbfe6
commit d36bb2de83
3 changed files with 69 additions and 7 deletions

View File

@@ -9,11 +9,15 @@ load_dotenv()
# 项目根目录
BASE_DIR = Path(__file__).resolve().parent
# WPS Webhook配置
WEBHOOK_URL = os.getenv(
"WEBHOOK_URL",
"https://xz.wps.cn/api/v1/webhook/send?key=da86927e491f2aef4b964223687c2c80"
)
def get_webhook_url():
"""动态获取Webhook URL"""
return os.getenv(
"WEBHOOK_URL",
"https://xz.wps.cn/api/v1/webhook/send?key=da86927e491f2aef4b964223687c2c80"
)
# WPS Webhook配置 - 使用函数动态获取
WEBHOOK_URL = get_webhook_url()
# 数据库配置
DATABASE_PATH = os.getenv("DATABASE_PATH", str(BASE_DIR / "data" / "bot.db"))
@@ -72,5 +76,4 @@ GAME_CONFIG = {
"max_concurrent_games": 5, # 每个聊天最多同时进行的游戏数
"board_size": 15, # 棋盘大小
},
}
}