Skip to content

Commit c0218ad

Browse files
committed
bug fix and add docs
1 parent a2bbd2d commit c0218ad

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

functions/monitor/send_message/pySendMessageByDingTalk.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@
1212
Create Date: 2017/11/20
1313
Create Time: 11:03
1414
Description: send alter message to somebody over DingTalk(Ali DingDing)
15-
Long Description:
15+
Long Description:
16+
17+
使用钉钉群自定义机器人发送消息到钉钉群的步骤:
18+
创建钉钉群聊(至少1个人,可以添加无关人再删除无关人达到至少1人的情况),使用PC端登录打开群聊,添加机器人
19+
建议使用“加签”安全设置,记录下签名密钥,如:SECc10***dc2
20+
参考文档:[自定义机器人接入](https://developers.dingtalk.com/document/app/custom-robot-access)
21+
创建完成后,记录好webhook地址,如:https://oapi.dingtalk.com/robot/send?access_token=40d654***c37
22+
webhook地址中有access_token,后续会使用到。
23+
1624
References: https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.karFPe&treeId=257&articleId=105735&docType=1
1725
Prerequisites: []
1826
Development Status: 3 - Alpha, 5 - Production/Stable
@@ -87,10 +95,10 @@ def send_message(access_token, title, content, mobile, enable_at_all=False):
8795
result_dict = json.loads(result_string)
8896
if result_dict["errcode"] == 0:
8997
print("send ok")
90-
print(json.dumps(result_string, indent=4))
98+
print(json.dumps(result_dict, indent=4))
9199
else:
92100
print("send failed")
93-
print(json.dumps(result_string, indent=4))
101+
print(json.dumps(result_dict, indent=4))
94102

95103

96104
if __name__ == '__main__':

0 commit comments

Comments
 (0)