如何在 Azure 机器人消息文本中添加超链接

How can I add a hyperlink in a Azure bot message text

我最近开始在 Node js 中创建 Azure Bot。我想在其中一个机器人响应中添加一个 hyperlink 并在用户单击它后发送主动响应。 类似于:

Please click this link to complete the payment.

并且 link 应该是一个超级link,它将重定向到一个端点。

我已经尝试找到一种方法来实现它,但到目前为止,我还没有能够实现。我看过以下 link:

https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-send-activity?view=azure-bot-service-4.0

https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-add-media-attachments?view=azure-bot-service-4.0&tabs=javascript

有人可以建议我实现这一目标的方法吗?

您可以使用 markdown 语法。

The text must be treated as markdown formatting and rendered on the channel as appropriate.

超链接降价语法:

[click this link](https://www.google.com/)

根据您的代码,它将如下所示:

Please [click this link](www.greetings.com) to complete the payment 

参考:

  1. Format text in chatbot
  2. Markdown syntax