修复webhook url指定
This commit is contained in:
15
config.py
15
config.py
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user