From 0522827b42fbe9a241027e8a1160088dba080a8b Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Sun, 9 Jan 2022 18:28:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- config/push.ini | 2 +- config/push.ini.example | 2 +- push.py | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5706a96..1dbcb75 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,4 @@ dmypy.json config/*.json # push配置 -config/push.ini +config/*.ini diff --git a/config/push.ini b/config/push.ini index 82709b6..f9df942 100644 --- a/config/push.ini +++ b/config/push.ini @@ -1,6 +1,6 @@ [setting] enable=false -#共有 cqhttp ftqq(sever酱) Pushplus +#共有 cqhttp ftqq(sever酱) pushplus push_server=cqhttp #server酱和pushplus的推送token push_token=123456 diff --git a/config/push.ini.example b/config/push.ini.example index 82709b6..f9df942 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -1,6 +1,6 @@ [setting] enable=false -#共有 cqhttp ftqq(sever酱) Pushplus +#共有 cqhttp ftqq(sever酱) pushplus push_server=cqhttp #server酱和pushplus的推送token push_token=123456 diff --git a/push.py b/push.py index 4548fc5..64ae450 100644 --- a/push.py +++ b/push.py @@ -51,10 +51,11 @@ def cq_http(status, push_message): def push(status, push_message): load_config() if cfg.getboolean('setting', 'enable'): - if cfg.get('setting', 'push_server') == "cqhttp": + push_server = cfg.get('setting', 'push_server').lower() + if push_server == "cqhttp": cq_http(status, push_message) - elif cfg.get('setting', 'push_server') == "ftqq": + elif push_server == "ftqq": ftqq(status, push_message) - elif cfg.get('setting', 'push_server') == "pushplus": + elif push_server == "pushplus": pushplus(status, push_message) return 0