如何在提交操作时编辑 MS Bot Framework Adaptive Card

How to edit MS Bot Framework Adaptive Card on submit action

在我的机器人中,我有一张带提交按钮的自适应卡片。我可以在提交操作时修改卡片或禁用按钮或删除此卡片吗?

在 Teams 中,您可以选择更新卡片消息。所以你可以使用类似的东西:

var newActivity = MessageFactory.Attachment(myUpdatedCard);
newActivity.Id = activityId //the Id of the original activity you sent;
await turnContext.UpdateActivityAsync(newActivity, cancellationToken);

发送新版卡片。