hostzg.com
科技智变,云启未来!

Telegram 消息格式化选项:MarkdownV2/HTML/Markdown格式

Telegram 发送消息的时候是可以进行格式化的,并且可以根据 MarkdownV2、HTML 或者 Markdown 格式进行格式化。本文简单记录一下 Telegram 格式化各种格式的消息的语法。

一、MarkdownV2 格式

*bold \*text*
_italic \*text_
__underline__
~strikethrough~
*bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*
[inline URL](http://www.example.com/)
[inline mention of a user](tg://user?id=123456789)
`inline fixed-width code`
```
pre-formatted fixed-width code block
```
```python
pre-formatted fixed-width code block written in the Python programming language
```

二、HTML 格式

<b>bold</b>, <strong>bold</strong>
<i>italic</i>, <em>italic</em>
<u>underline</u>, <ins>underline</ins>
<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
<b>bold <i>italic bold <s>italic bold strikethrough</s> <u>underline italic bold</u></i> bold</b>
<a href="http://www.example.com/">inline URL</a>
<a href="tg://user?id=123456789">inline mention of a user</a>
<code>inline fixed-width code</code>
<pre>pre-formatted fixed-width code block</pre>
<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>

三、Markdown 格式

*bold text*
_italic text_
[inline URL](http://www.example.com/)
[inline mention of a user](tg://user?id=123456789)
`inline fixed-width code`
```
pre-formatted fixed-width code block
```
```python
pre-formatted fixed-width code block written in the Python programming language
```

参考链接:https://core.telegram.org/bots/api#markdownv2-style

赞(0) 打赏
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《Telegram 消息格式化选项:MarkdownV2/HTML/Markdown格式》
文章链接:https://hostzg.com/5258.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

主机中国网 - 科技智变,云启未来!

HOSTZG 是一个专注于VPS主机资讯、测评与推荐的平台。我们致力于为用户提供全球优质VPS主机的最新信息、详细测评和实用推荐,帮助用户找到最适合的服务器解决方案。无论您是个人用户还是企业用户,HOSTZG 都能为您提供专业、可靠的主机资讯服务。

腾讯云阿里云

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫