1 Star 0 Fork 12

有来有去/:O / ddtalk_ldap

forked from single_yang / ddtalk_ldap 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
message.py 666 Bytes
一键复制 编辑 原始数据 按行查看 历史
杨宇航 提交于 2020-11-20 15:43 . 更新代码。
from settings import MOBILE_NUMBER, WEBHOOK
import requests
import json
def SendMessage(info):
message = {
"msgtype": "markdown",
"markdown": {
"title": "变更通知",
"text": f"#### {info['type']} \n> 姓名: {info['username']} \n 部门: {info['department']} \n 岗位: {info['position']}"
},
"at": {
"atMobiles": [
MOBILE_NUMBER
],
"isAtAll": False
}
}
headers = {'Content-Type': 'application/json'}
try:
requests.post(url=WEBHOOK, data=json.dumps(message), headers=headers)
except Exception as e:
print(e)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/weyoung3350/ddtalk_ldap.git
git@gitee.com:weyoung3350/ddtalk_ldap.git
weyoung3350
ddtalk_ldap
ddtalk_ldap
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891