From 25f358d511d458789ac77f80a555ecc3b064ce0f Mon Sep 17 00:00:00 2001 From: Anye <1844960181@qq.com> Date: Thu, 13 Oct 2022 13:19:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A3=9E=E4=B9=A6=E6=8E=A8?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/push.ini.example | 11 +++++++---- push.py | 11 +++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/config/push.ini.example b/config/push.ini.example index ffc8e7c..1cd7057 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -1,9 +1,9 @@ [setting] enable=true -#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot bark pushdeer gotify smtp(邮件推送) -push_server=cqhttp -#server酱 pushplus dingrobot 的推送token -push_token=123456 +# 共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot feishubot bark pushdeer gotify smtp(邮件推送) +push_server=pushplus +# server酱 pushplus dingrobot 的推送token +push_token=XXXXXX [cqhttp] #cqhttp的服务端地址 @@ -32,6 +32,9 @@ token= webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX secret= +[feishubot] +webhook=https://open.feishu.cn/open-apis/bot/v2/hook/XXX + [bark] api_url=https://api.day.app token=ssXXX diff --git a/push.py b/push.py index 93a5449..fcf2294 100644 --- a/push.py +++ b/push.py @@ -170,6 +170,17 @@ def dingrobot(send_title, push_message): ).json() log.info(f"推送结果:{rep.get('errmsg')}") +# 飞书机器人 +def feishubot(send_title, push_message): + api_url = cfg.get('feishubot', 'webhook') # https://open.feishu.cn/open-apis/bot/v2/hook/XXX + rep = http.post( + url=api_url, + headers={"Content-Type": "application/json; charset=utf-8"}, + json={ + "msg_type": "text", "content": {"text": send_title + "\r\n" + push_message} + } + ).json() + log.info(f"推送结果:{rep.get('msg')}") # Bark def bark(send_title, push_message):