我在 C# 中使用 Microsoft Bot Framework 编写了一个机器人,并在其中包含了以下 html
await context.PostAsync($"How would you like to connect, {username} ?");
StringBuilder sb = new StringBuilder();
sb.Append("<html><head>");
sb.Append("<style>");
sb.Append(".button{"); sb.Append("padding:10px25px;background-color:white;text-align:center;cursor:pointer;outline:none;color:#66b3ff;background-color:white;border-width:1px;border-color:#a6a6a6;border-radius:0px;}");
sb.Append(".button:hover{"); sb.Append("border-color:#66b3ff;color:#66b3ff;background-color:white;}");
sb.Append(".button:active{"); sb.Append("color:white;background-color:#66b3ff;border-color:#66b3ff;}");
sb.Append("</style>");
sb.Append("</head><body>");
sb.Append("<a href=\"mailto:abc@abc.com?Subject=Place%20Subject%20here");
sb.Append("\" target=\"_top\"><button class=\"button\">");
sb.Append("Connect with Mail"); sb.Append("</button></a>");
sb.Append("<a href=\"tel:+1111111111\"><button class=\"button\">");
sb.Append("Connect with Call"); sb.Append("</button></a>");
sb.Append("</body></html>");
await context.PostAsync(sb.ToString());
在机器人模拟器中测试时,它工作正常。看起来像这样
但后来我使用直接通道 api 部署了它。它直接显示html代码而不是上面给出的按钮。在网页上运行时会显示
我很抱歉拍了一张糟糕的照片。有没有办法使用直线 api 在机器人中显示 html?