python3钉钉机器人主动推送版

我们要进去群里设置
然后获取Webhook

企业自定义文档
https://ding-doc.dingtalk.com/doc#/serverapi2/elzz1p

import requests
import jsondef dindingmag):HEADERS = {"Content-Type": "application/json;charset=utf-8"}key = "access_token"url = "xx/send?access_token=%s" % keydata_info = {'msgtype' : 'text','text' : {'content' : '我想说的话:' + mag},'isAtAll' : True}value = json.dumpsdata_info)response = requests.posturl, data=value, headers=HEADERS)printresponse.status_code)if __name__ == '__main__':msg = '总裁我错了'dindingmsg)

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注