|
@@ -0,0 +1,17 @@
|
|
|
+import requests
|
|
|
+
|
|
|
+class FeishuBot:
|
|
|
+ webhook_url = "https://open.feishu.cn/open-apis/bot/v2/hook/your_webhook_id"
|
|
|
+
|
|
|
+ def __init__(self):
|
|
|
+ self.webhook_url = self.webhook_url
|
|
|
+
|
|
|
+ def send_message(self, message_text):
|
|
|
+ headers = {'Content-Type': 'application/json'}
|
|
|
+ data = {
|
|
|
+ "msg_type": "text",
|
|
|
+ "content": {"text": message_text}
|
|
|
+ }
|
|
|
+ response = requests.post(self.webhook_url, json=data, headers=headers)
|
|
|
+ response.raise_for_status()
|
|
|
+ return response.json()
|