19 lines
566 B
Python
19 lines
566 B
Python
import requests
|
|
import setting
|
|
import urllib3
|
|
|
|
url = 'https://oapi.dingtalk.com/robot/send?access_token=c197bfacc77010e92804ecdbb6a6e0f95f86d9e7e4968fb35ec68720eeec8fa8'
|
|
|
|
# 发送消息
|
|
def send_message(text, isAtAll = False):
|
|
formData = {
|
|
"msgtype": "text",
|
|
"text": {
|
|
"content": text
|
|
},
|
|
"at": {
|
|
"isAtAll": isAtAll
|
|
}
|
|
}
|
|
urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequestWarning)
|
|
print(requests.post(url, json=formData, verify=False).json()) |