当前位置:网站首页>推送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
}
}
边栏推荐
- 2022-06-10 work record --js- obtain the date n days after a certain date
- Web security XSS foundation 06
- STP spanning tree protocol Foundation
- Cases of addition, deletion, modification and search of C # learning for two years and C # import and export (de duplication)
- Introduction to machine learning compilation course learning notes lesson 1 overview of machine learning compilation
- Data communication and physical network
- vulnhub Vegeta: 1
- Leetcode algorithm refers to offer II 027 Palindrome linked list
- 【Mongodb】READ_ ME_ TO_ RECOVER_ YOUR_ Data, the database is deleted maliciously
- win10或win11打印机无法打印
猜你喜欢

Database transaction Transanction

Recommended course: workplace writing training

What kind of processor architecture is ARM architecture?

Servlet

【Mongodb】READ_ME_TO_RECOVER_YOUR_DATA,数据库被恶意删除

结合源码剖析Oauth2分布式认证与授权的实现流程

Environment configuration | vs2017 configuring openmesh source code and environment

vulnhub DC: 2

别再乱用了,这才是 @Validated 和 @Valid 的真正区别!!!

Design and implementation of spark offline development framework
随机推荐
MySQL夺命10问,你能坚持到第几问?
Envoy obtain the real IP address of the client
How to submit the shopee opening and settlement flow?
Principle of IP routing
Attackg: constructing technical knowledge graph from cyber thread intelligence reports
EPICS记录参考2--EPICS过程数据库概念
Epics record reference 3 -- fields common to all records
关于某手滑块的一些更新(6-18,js逆向)
Solution to the login error of tangdou people
cat写多行内容到文件
vulnhub Vegeta: 1
Annotation
EPICS记录参考4--所有输入记录都有的字段和所有输出记录都有的字段
中国SSD行业企业势力全景图
糖豆人登录报错解决方案
Common sense of resolution
China solar window market trend report, technical dynamic innovation and market forecast
Research and investment strategy report on China's building steel structure anticorrosive coating industry (2022 Edition)
详细了解Redis的八种数据类型及应用场景分析
【ROS玩转Turtlesim小海龟】