You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-project/api/dingding.py

33 lines
671 B

3 years ago
#!/usr/bin/python3
#-*-coding: utf-8-*-
# by QianFeng.newrain
#
'''
Welcome QianFeng cloud computing
'''
import requests
import json
import sys
import os
import datetime
import sys
headers = {'Content-Type': 'application/json;charset=utf-8'}
3 years ago
# 需要修改,钉钉群助手中获取
api_url = ""
def msg(text):
json_text= {
"msgtype": "text",
"at": {
"atMobiles": [
"all"
],
"isAtAll": False
},
"text": {
"content": text
}
}
print(requests.post(api_url,json.dumps(json_text),headers=headers).content)
msg(sys.argv[1]+'\n'+sys.argv[2]+'\n'+sys.argv[3])