gpt4 book ai didi

node.js - Microsoft BotBuilder node.js : How to send formatted text (BOLD , 斜体(换行))到 Android Skype for Business 客户端(从 Bot)

转载 作者:太空宇宙 更新时间:2023-11-03 23:22:23 25 4
gpt4 key购买 nike

我们在 Node js 中使用 Microsoft BotBuilder 实现了一个机器人,以主动向 Skype for Business 用户发送消息。我们需要发送一些格式化文本,例如粗体、斜体和换行符(新行),但 Android Skype for Business 似乎不支持任何这些格式。所有 Html 格式在所有平台(iOS、Android 和 MAC)中均显示为原始 HTML。到目前为止,我们已经尝试了以下方法来发送格式化文本。

//1 using \n\n
var msgToSend = new builder.Message()
.text("Hello \n\n World!");
//2 using unicodes
var msgToSend = new builder.Message()
.text("Hello \u0085 \u2028 World!");
//using html formatting
var msgToSend = new builder.Message()
.text("Hello </br> World!");


bot.loadSession(addr1, function (err, session) {
bot.send(msgToSend);
});

我们成功地将新行文本发送到 Mac、iOS 和 Windows Skype for Business 客户端,但这些似乎都不适用于 Android。任何将格式化文本发送到 android 的帮助将不胜感激。

最佳答案

正如已经在围绕同一主题的问题中回答的那样(关于网络聊天和渲染 HTML):

Microsoft Bot Framework 仅支持 2 种类型的文本格式(请参阅文档 here):

  • Markdown
  • XML(textFormat xml 仅受 Skype channel 支持。)

结果:

  • HTML 在这里无法为您提供帮助
  • 您受限于 Markdown 的功能以及 channel 中 Markdown 渲染的限制

如果您查看 Channel Inspector 中的 Skype for Business Markdown ,不可能做你想做的事(粗体、斜体等未按预期呈现),抱歉

enter image description here

关于node.js - Microsoft BotBuilder node.js : How to send formatted text (BOLD , 斜体(换行))到 Android Skype for Business 客户端(从 Bot),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48303796/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com