我正在在使用任务模块并发送自适应卡的团队中构建消息传递扩展。
我想从消息传递命令和发送给用户的自适应卡上的按钮中调用相同的任务模块。
通过该应用程序的预期流量如下:
最终用户通过单击Compose Box下的消息传递扩展命令来启动包含React页面的任务模块 - >用户在任务模块中找到对象 - >用户单击“ React”页面上的“导出到聊天”按钮 - > microsoftteams.tasks.submittask()
在React Page ->任务模块关闭 - > in the bot activity handler handleTeamsMessagingExtensionSubmitAction
returns a botMessagePreview like shown
自适应卡中包含一个按钮“查看对象”:
{
type: "Action.Submit",
title: "View Object",
data: {
msteams: {
type: "task/fetch",
},
goToUrl: url,
},
}
从自适应卡中,我可以调用一个任务模块,但是这次我必须使用 HandleteamStaskModulefetch
而不是 handleteamSmessagingExtensigensextensionFetchTask
。这意味着,一旦最终用户提交了任务模块,他们就不会看到BotMessagePreview,因为该功能似乎是消息扩展的独特之处。有什么办法可以解决这个问题?
迄今为止显示BotMessagePreview。
I am building a messaging extension in Teams that uses task modules and sends adaptive cards.
I want to invoke the same task module from both a messaging extension command and from a button on an adaptive card that is sent to the user.
The intended flow through the application is the following:
End user launches a task module containing a react page by clicking a messaging extension command under the compose box -> user finds an object in the task module -> user clicks an 'export to chat' button on the react page -> microsoftTeams.tasks.submitTask()
is triggered on the react page -> task module closes -> in the bot activity handler handleTeamsMessagingExtensionSubmitAction
returns a botMessagePreview like shown here -> user is able to preview the adaptive card and can send it as a message from the bot to the chat.
The adaptive card contains a button "View Object":
{
type: "Action.Submit",
title: "View Object",
data: {
msteams: {
type: "task/fetch",
},
goToUrl: url,
},
}
From the adaptive card, I am able to invoke a task module, but this time I have to use handleTeamsTaskModuleFetch
instead of handleTeamsMessagingExtensionFetchTask
. This means that once the end user submits the task module they will not see the botMessagePreview because that functionality seems to be exclusive to the messaging extension. Is there any way I can work around this?
So far I have tried duplicating my logic from the messaging extension handlers in handleTeamsTaskModuleFetch
and handleTeamsTaskModuleSubmit
but I haven't found a way to avoid side effects that crash my app or a way to display the botMessagePreview.
发布评论
评论(1)
似乎无法从任务/提交活动调用BotMessagePreview。
BotMessagePreview功能不支持任务/提交活动。
此功能在消息扩展中支持。
参考文档:
This seems to be not possible to invoke a botMessagePreview from a task/submit activity.
botMessagePreview functionality is not supported for task/submit activity.
This functionality supported in Messaging extension.
Ref Doc: https://learn.microsoft.com/en-us/microsoftteams/platform/resources/messaging-extension-v3/create-extensions?tabs=typescript