Browse Source

add bot to daily tasks

luojunhui 8 tháng trước cách đây
mục cha
commit
a1f1ae1b60
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      applications/feishuBotApi.py

+ 2 - 1
applications/feishuBotApi.py

@@ -16,6 +16,7 @@ def bot(title, detail, mention=True):
         "content": "{}<at id=all></at>\n".format(title) if mention else "{}\n".format(title),
         "tag": "lark_md",
     }
+    head_title = "【重点关注】" if mention else "【 普通通知 】"
     url = "https://open.feishu.cn/open-apis/bot/v2/hook/b44333f2-16c0-4cb1-af01-d135f8704410"
     headers = {"Content-Type": "application/json"}
     payload = {
@@ -36,7 +37,7 @@ def bot(title, detail, mention=True):
                     },
                 },
             ],
-            "header": {"title": {"content": "【重点关注】", "tag": "plain_text"}},
+            "header": {"title": {"content": head_title, "tag": "plain_text"}},
         },
     }
     requests.request("POST", url=url, headers=headers, data=json.dumps(payload), timeout=10)