Microsoft 团队使用 activity id 删除自适应卡

Microsoft teams delete an adaptive card using activity id

我正在使用 nodejs 并能够显示具有以下操作的自适应卡片

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

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

所以基本上在按钮上,我传递了当前上下文的 activity id。

现在在 hideDetails 上,代码如下所示

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

但是,我遇到了以下错误

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)

这是怎么回事?

复制评论中的答案以提高可见性。

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.