问题描述
您好,我正在使用自适应卡,并希望生成一个可在MS Teams和Webchat中使用的Submit Action.
Hi i'm using adaptive Cards and want to generate a Submit Action which works in MS Teams as well as in Webchat.
在模拟器"中可以正常工作.我单击按钮后,就像用户输入测试"在聊天中.
In Emulator this works fine. After i'm clicking the Button its like the user would type in"Test" in the chat.
"actions": [
{
"type": "Action.Submit",
"title": "Test",
"data": "Test"
}
这在MS Teams中不起作用.如何发挥作用?
This doesnt work in MS Teams. How to bring this to work?
推荐答案
我的博客文章解释说,如果要使用字符串提交操作,则需要在Web聊天和团队中执行以下操作:"> https://blog.botframework.com/2019/07/02/在Microsoft机器人框架中使用自适应卡片/
My blog post explains that if you want to use a string submit action you will need to do it differently in Web Chat and Teams: https://blog.botframework.com/2019/07/02/using-adaptive-cards-with-the-microsoft-bot-framework/
如果您想在两个通道中以相同的方式进行相同的提交操作,则需要将其作为对象提交操作.如果您希望一个字符串提交操作在两个通道上都起作用,那么您的漫游器将需要检查活动来自哪个通道并做出相应的反应.
If you want to have the same submit action work the same way in both channels, it will need to be an object submit action. If you want a string submit action to work on both channels then your bot will need to check which channel the activity came from and react accordingly.
这篇关于如何为同样在Web聊天中工作的MSTeams重写自适应卡提交动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!