DingTalkUtils.py 566 B

1234567891011121314151617181920212223
  1. import requests
  2. import random
  3. url = "https://oapi.dingtalk.com/robot/send?access_token=8c4c99b4b2ca152fb0a5f21b368fae743a64b4ccecac01548a8620fe7f63a0ca"
  4. headers = {'Content-Type': 'application/json;charset=utf-8'}
  5. def send(msg):
  6. data = {'msgtype': 'text',
  7. "at": {"isAtAll": True,
  8. "atMobiles": []},
  9. "text": {"content": "[代码发布]"+msg}}
  10. requests.post(url=url, headers=headers, json=data)
  11. if __name__ == '__main__':
  12. send("双击打开撒就发了")
  13. # 发送的内容得加上趣程