#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: 刘小懒
# example:python3 feishu.py 参数
import json
import sys
import requests
# 你复制的webhook地址
url = "https://open.feishu.cn/xxxxxxxxxxxxxxx"
def send_message(message):
payload_message = {
"msg_type": "text",
"content": {
"text": message
}
}
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=json.dumps(payload_message))
return response
if __name__ == '__main__':
text = sys.argv[1]
send_message(text)