From f73be05949c96a47a469189b88b788f167a1a915 Mon Sep 17 00:00:00 2001 From: Akimio521 Date: Sun, 25 Feb 2024 15:50:08 +0800 Subject: [PATCH] =?UTF-8?q?PUSHME=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample/notify.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sample/notify.py b/sample/notify.py index 08ad979b..9560c773 100644 --- a/sample/notify.py +++ b/sample/notify.py @@ -753,16 +753,17 @@ def smtp(title: str, content: str, **kwargs) -> None: print(f"SMTP 邮件 推送失败!{e}") -def pushme(title: str, content: str) -> None: +def pushme(title: str, content: str, **kwargs) -> None: """ 使用 PushMe 推送消息。 """ - if not push_config.get("PUSHME_KEY"): + if not (kwargs.get("PUSHME_KEY") or push_config.get("PUSHME_KEY")): print("PushMe 服务的 PUSHME_KEY 未设置!!\n取消推送") return print("PushMe 服务启动") + PUSHME_KEY = kwargs.get("PUSHME_KEY", push_config.get("PUSHME_KEY")) - url = f'https://push.i-i.me/?push_key={push_config.get("PUSHME_KEY")}' + url = f'https://push.i-i.me/?push_key={PUSHME_KEY}' data = { "title": title, "content": content,