首先在给群组创建机器人,机器人通过关键字验证,设置关键字为Notice
完整代码
"""
推送钉钉消息到群组工具
"""
import json
import requests
class MessageBody(object):
""" 推送消息内容体
"""
def __init__(self, title="", msg=""):
"""初始化一个消息体
Keyword Arguments:
title {str} -- 消息标题 (default: {""})
msg {str} -- 消息体 (default: {""})
"""
super().__init__()
self._msg = title
self._title = msg
@property
def msg