我正在尝试基于 v4 bot SDK 创建 Teams 消息传递扩展,该扩展可搜索知识库并提供可放入聊天中的建议响应。搜索有效,我可以选择一张卡片放入聊天中,但我想去掉格式,只将一段文本返回到聊天中(即我不希望聊天中的其他人看到响应来自扩展)。我可以在搜索结果中指定卡片列表,并且我尝试将 HeroCard 搜索结果结果的 cardAction 属性设置为“messageBack”,但这仍然会将完整的卡片放入团队聊天中。我尝试模拟一些简单的东西,只有一个静态响应,看看我是否可以让它工作:
MessagingExtensionResult composeExtensionResult = new MessagingExtensionResult
{
Type = "result",
AttachmentLayout = "list",
Attachments = new List<MessagingExtensionAttachment>(),
};
HeroCard h = new HeroCard()
{
Title="Intro",
Text="Hello, my name is Inigo Montoya, you killed my father, prepare to die.",
Tap=new CardAction()
{
Type= "messageBack",
DisplayText="send message",
Text="111",
},
};
composeExtensionResult.Attachments.Add(h.ToAttachment().ToMessagingExtensionAttachment());
知道是否有办法获得纯文本响应,或者机器人响应是否总是归因于机器人?
所以看来上面的例子毕竟有效(某种程度上)。我尝试将卡更改为如下格式:
HeroCard h = new HeroCard()
{
Text="Hello, my name is Inigo Montoya, you killed my father, prepare to die.",
};
Which puts in a card-like response when I use the compose extension:
If I look at this same post as another user though, I get this:
So it appears that this is intentional, but perhaps not documented as well as it could be. It is worth noting that the contents of the card will still be sent, just not the overall compose extension title and image.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)