当前位置:网站首页>推送Markdown格式信息到钉钉机器人
推送Markdown格式信息到钉钉机器人
2022-06-24 19:41:00 【樵歌出林】
1.自定义机器人设置
根据钉钉官方开放文档进行自定义机器人的配置,文档地址为:自定义机器人接入 - 钉钉开放平台 (dingtalk.com)
2.Markdown推送形式
- Markdown类型
- 参数说明
3.Markdown图片格式
Markdown中可以使用url连接的图片进行推送,格式为:,需注意:此url连接地址获取可从第三方(如oss)获取,也可在本地使用apache2创建http服务器自我生成,生成方法和流程可参考另一篇博文“使用apache2创建http服务器生成图像url"。
如需在Markdown中引入变量,可在文本字符串前加入“f",并在字符串中对需要引入的变量添加花括号进行标明,即f"{变量名}/n/n"。此处注意,如果在引入"f"后需要对后续字符串进行加粗(**需加粗的字符串**),则需要在加粗的字符串**之后,添加“/n",否则钉钉推送的消息在手机APP端显示异常(电脑端正常)
text = {
"msgtype": "markdown",
"markdown": {
"title": "警告",
"text": "#### **消息预警** @all \n"
f"> **时间:**\n{t0}\n\n"
f"> **类型:**\n{type}\n\n"
f"> **报警信息:**\n{reason}\n\n"
f"> \n\n"
f"> ###### {t0}发布 \n"
},
"at": {
"atMobiles": [
],
"atUserIds": [
],
"isAtAll": True
}
}
边栏推荐
- Layer 2 and layer 3 forwarding principle based on VLAN
- Row and column differences in matrix construction of DX HLSL and GL glsl
- Research Report on market evaluation and investment direction of Chinese dermatology drugs (2022 Edition)
- Annotation
- Analyze the implementation process of oauth2 distributed authentication and authorization based on the source code
- See how sparksql supports enterprise data warehouse
- [untitled]
- The difference between interceptor and filter
- Recommended movies: Northeast tiger, licorice pizza
- Fanuc robot_ Introduction to Karel programming (1)
猜你喜欢
go Cobra命令行工具入门
docker安装mysql-简单无坑
vulnhub Vegeta: 1
Environment configuration | vs2017 configuring openmesh source code and environment
Talk about GC mechanism often asked in interview
Parental delegation mechanism
研究生宿舍大盘点!令人羡慕的研究生宿舍来了!
Leetcode: calculate the number of elements less than the current element on the right (sortedlist+bisect\u left)
【nvm】
Cases of addition, deletion, modification and search of C # learning for two years and C # import and export (de duplication)
随机推荐
Research Report on solar battery charger industry - market status analysis and development prospect forecast
【Mongodb】READ_ME_TO_RECOVER_YOUR_DATA,数据库被恶意删除
Problem solving - nested lists
花房集团二次IPO:成于花椒,困于花椒
2022年安全员-A证考题及答案
研究生宿舍大盘点!令人羡慕的研究生宿舍来了!
The difference between get and post
【文本数据挖掘】中文命名实体识别:HMM模型+BiLSTM_CRF模型(Pytorch)【调研与实验分析】
[personal experiment report]
vulnhub DC: 2
Envoy obtain the real IP address of the client
What kind of processor architecture is ARM architecture?
证件照处理
cat写多行内容到文件
MySQL夺命10问,你能坚持到第几问?
结构体的内存对齐
EPICS記錄參考3 -- 所有記錄都有的字段
Analyze the implementation process of oauth2 distributed authentication and authorization based on the source code
ACL (access control list) basic chapter - Super interesting learning network
大厂面试必问:如何解决TCP可靠传输问题?8张图带你详细学习