renyupeng 2 лет назад
Родитель
Сommit
d13748d474
1 измененных файлов с 9 добавлено и 2 удалено
  1. 9 2
      utils/send_feishu_msg.py

+ 9 - 2
utils/send_feishu_msg.py

@@ -21,7 +21,7 @@ class SendFeiShuMsg:
     @staticmethod
     def send_robot_msg(msg_content):
         try:
-            url = 'https://open.feishu.cn/open-apis/bot/v2/hook/7abdd37f-4a8e-4d6c-840e-ed78e892f019'
+            url = 'https://open.feishu.cn/open-apis/bot/v2/hook/6f1e77f2-cdc3-48d6-957e-4c9953da55c0'
             req_head = {"Content-Type": "application/json"}
             req_data = {
                 "msg_type": "text",
@@ -46,7 +46,7 @@ class SendFeiShuMsg:
     @staticmethod
     def send_cookie_robot_msg(msg_content):
         try:
-            url = 'https://open.feishu.cn/open-apis/bot/v2/hook/6f1e77f2-cdc3-48d6-957e-4c9953da55c0'
+            url = 'https://open.feishu.cn/open-apis/bot/v2/hook/ce075a9a-e224-4435-8028-55ae509b4b32'
             req_head = {"Content-Type": "application/json"}
             req_data = {
                 "msg_type": "text",
@@ -55,9 +55,12 @@ class SendFeiShuMsg:
                 }
             }
             data = json.dumps(req_data)
+            print(data)
             logging.info("send_robot_msg req_url:{}, req_data:{}".format(url, data))
             response = requests.post(url=url, data=data, headers=req_head)
+            print(response.text)
             result = response.json()
+            print(result)
             logging.info("send_robot_msg response:{}".format(response.json()))
             if result.get("StatusCode") == 0:
                 logging.info("飞书通知发送成功")
@@ -67,3 +70,7 @@ class SendFeiShuMsg:
                 return False
         except Exception as e:
             logging.error("send_robot_msg Error:{}".format(traceback.format_exc()))
+
+
+if __name__ == '__main__':
+    SendFeiShuMsg.send_robot_msg('11111')