我是靠谱客的博主 尊敬裙子,这篇文章主要介绍python发送钉钉机器人脚本,现在分享给大家,希望可以做个参考。

#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import json
import sys
import os

headers = {'Content-Type': 'application/json;charset=utf-8'}
api_url = "https://oapi.dingtalk.com/robot/send?access_token=xxxxxx"

def msg(text):
json_text= {
"msgtype": "text",
"at": {
"atMobiles": [
"120xxx", "130xxx"
],
"isAtAll": False
},
"text": {
"content": text
}
}
print requests.post(api_url,json.dumps(json_text),headers=headers).content

if __name__ == '__main__':
text = sys.argv[1]
msg(text)

转载于:https://www.cnblogs.com/Qing-840/p/9267926.html

最后

以上就是尊敬裙子最近收集整理的关于python发送钉钉机器人脚本的全部内容,更多相关python发送钉钉机器人脚本内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(187)

评论列表共有 0 条评论

立即
投稿
返回
顶部