[英]How to create a Teams app that starts with a modal dialog
I'm trying to create a Teams app, let's call it 'TestApp', such that when it's invoked from a Teams Channel via @TestApp [ENTER], a modal dialog will appear, allowing the user to set various options, then click OK when done. 我正在尝试创建一个Teams应用程序,我们称之为'TestApp',这样当通过@TestApp [ENTER]从Teams Channel调用时,会出现一个模态对话框,允许用户设置各种选项,然后单击OK。完成后。
So far I've been focusing on "task modules" from a Microsoft Teams bot - see: https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/task-modules/task-modules-bots - but I don't understand how to set the "value" object of an invoke card action to type task/fetch when first starting the bot (or even if that's the right approach for a Teams app). 到目前为止,我一直专注于Microsoft Teams bot的“任务模块” - 请参阅: https : //docs.microsoft.com/en-us/microsoftteams/platform/concepts/task-modules/task-modules-bots-但我不明白如何设置调用卡操作的“值”对象,以便在首次启动机器人时键入task / fetch(或者即使这是Teams应用程序的正确方法)。 I can sort of see how an adaptive card could be returned as a response, containing a button for invoking the task module, but don't see how to do it initially.
我可以看看自适应卡如何作为响应返回,包含一个用于调用任务模块的按钮,但最初看不到如何操作。 I've loaded 'TaskModule.zip' - see: https://github.com/OfficeDev/microsoft-teams-sample-task-module-nodejs - into my Teams, but that doesn't initially start as a modal dialog.
我加载了'TaskModule.zip' - 请参阅: https : //github.com/OfficeDev/microsoft-teams-sample-task-module-nodejs - 进入我的团队,但最初并不是作为模态对话框启动的。
For an example of what I'm trying to achieve, see how the @praise bot starts up. 有关我想要实现的示例,请参阅@praise bot如何启动。 After typing @praise [ENTER], a modal dialog appears - that's what I'm trying to achieve.
输入@praise [ENTER]后,会出现一个模态对话框 - 这就是我想要实现的目标。
Here is the documentation on how to Respond with an adaptive card message sent from a bot . 以下是有关如何响应机器人发送的自适应卡消息的文档。
Sample JSON: 示例JSON:
{
"composeExtension": {
"type": "botMessagePreview",
"activityPreview": {
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": << Card Payload >>
}
]
}
}
}
Your message extension will now need to respond to two new types of interactions, value.botMessagePreviewAction = "send"
and value.botMessagePreviewAction = "edit"
. 您的邮件扩展现在需要响应两种新类型的交互,
value.botMessagePreviewAction = "send"
和value.botMessagePreviewAction = "edit"
。
Please go through the documentation. 请仔细阅读文档。 You can raise such issues directly on respective documentation page.
您可以直接在相应的文档页面上提出此类问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.