Commit 0a1603cb by fanxun

发送消息到钉钉群

parent f3ca18a2
import requests
import json
from config import BaseConfig
class RedisBase: class RedisBase:
pass pass
def dingTalk(webhook, message):
"""发送消息到钉钉群"""
data = {'msgtype': 'text', 'text': {"content": message},
'at': {'isAtAll': True}}
post_data = json.dumps(data)
response = requests.post(webhook, headers=BaseConfig.headers, data=post_data)
return response.text
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment