如何使用bot api在电报中制作斜体下划线文本,并在其中包含链接?

问题描述 投票:0回答:1

我使用 telegram bot api 在 C# 上编写自己的机器人。我想知道,如何同时使文本变为斜体和下划线,并在此格式化文本中的任何单词内传递一些超链接?

enter image description here

我想像上面的截图一样

telegram-bot
1个回答
0
投票

您应该使用

MarkdownV2
作为
sendMessage
parse_mode
,然后就可以

  1. 使用
    _some text_
  2. 创建斜体文本
  3. 使用
    [some text](https://google.com)
  4. 创建超链接
  5. 使用
    __some text__
  6. 创建带下划线的文本

结合这些:

_Some italic text with a __[hyperlink](https://google.com)___

将发送如下消息:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.