简体   繁体   English

Microsoft 团队使用活动 ID 删除自适应卡片

[英]Microsoft teams delete an adaptive card using activity id

I am using nodejs and able to show an adaptive card with action as below我正在使用 nodejs 并且能够显示具有如下操作的自适应卡

{
                "type": "Action.Submit",
                "title": "Hide details",
                "data": { "action" : "hideDetails", "activity_id": context.activity.id}
            }

....
await context.sendActivity(myCard);

so basically on the button, i am passing the activity id of the current context.所以基本上在按钮上,我正在传递当前上下文的活动 ID。

now on the hideDetails the code looks like below现在在 hideDetails 上,代码如下所示

 async hideDetails(context:any, activityId:any){
        await context.deleteActivity(activityId)
}

However, I am getting below error但是,我得到以下错误

Invalid activity ID f:ef8e3a07-59fe-2eb9-a717-e89c0ca664ba
    at new RestError (/workspace/node_modules/@azure/ms-rest-js/dist/msRest.node.js:1397:28)

what's wrong here?这里有什么问题?

Copying the answer from comments for better visibility.从评论中复制答案以获得更好的可见性。

ReplyToId of the Activity Property can be used to Update or delete the message posted to the bot and this is illustrated in Teams Conversation Bot code sample . Activity 属性的ReplyToId可用于更新或删除发布到机器人的消息,这在 Teams Conversation Bot 代码示例中进行了说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM