mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-25 00:16:06 +08:00
飞书机器人自定义参数
This commit is contained in:
parent
01a40e21b3
commit
ad0181cda8
|
@ -208,16 +208,16 @@ def dingding_bot(title: str, content: str, **kwargs) -> None:
|
||||||
print("钉钉机器人 推送失败!")
|
print("钉钉机器人 推送失败!")
|
||||||
|
|
||||||
|
|
||||||
def feishu_bot(title: str, content: str) -> None:
|
def feishu_bot(title: str, content: str, **kwargs) -> None:
|
||||||
"""
|
"""
|
||||||
使用 飞书机器人 推送消息。
|
使用 飞书机器人 推送消息。
|
||||||
"""
|
"""
|
||||||
if not push_config.get("FSKEY"):
|
if not (kwargs.get("DD_BOT_SECRET") or push_config.get("FSKEY")):
|
||||||
print("飞书 服务的 FSKEY 未设置!!\n取消推送")
|
print("飞书 服务的 FSKEY 未设置!!\n取消推送")
|
||||||
return
|
return
|
||||||
print("飞书 服务启动")
|
print("飞书 服务启动")
|
||||||
|
FSKEY = kwargs.get("DD_BOT_SECRET", push_config.get("FSKEY"))
|
||||||
url = f'https://open.feishu.cn/open-apis/bot/v2/hook/{push_config.get("FSKEY")}'
|
url = f'https://open.feishu.cn/open-apis/bot/v2/hook/{FSKEY}'
|
||||||
data = {"msg_type": "text", "content": {"text": f"{title}\n\n{content}"}}
|
data = {"msg_type": "text", "content": {"text": f"{title}\n\n{content}"}}
|
||||||
response = requests.post(url, data=json.dumps(data)).json()
|
response = requests.post(url, data=json.dumps(data)).json()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user