且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在直线上单击后,建议的操作会消失

更新时间:2023-11-22 23:24:04

根据文档此处:

与出现在丰富卡片中的按钮不同(即使在被点击后,这些卡片仍然对用户可见并可以访问),在用户做出选择后,显示在建议操作窗格中的按钮将消失.这样可以防止用户在对话中点击过时的按钮,并简化了漫游器开发(因为您无需考虑这种情况).

Unlike buttons that appear within rich cards (which remain visible and accessible to the user even after being tapped), buttons that appear within the suggested actions pane will disappear after the user makes a selection. This prevents the user from tapping stale buttons within a conversation and simplifies bot development (since you will not need to account for that scenario).

因此,简而言之,您无法通过建议的操作来实现所需的结果.您有两种选择:

So in short, you cannot achieve your desired outcome with suggested actions. You have a couple of options:

  1. 在您的机器人代码中处理建议操作,并将回复发送给用户,感谢他们的输入(并可能向他们重复他们的输入谢谢您选择X").
  2. 根据此日期 自适应卡(新方法),有一个示例详细指南.
  1. Handle the suggest action in your bot code and send a reply back to the user thanking them for their input (and potentially repeating their input back to them "thank you for selecting X").
  2. Using a CardAction instead, as per this dated sample.
  3. Use an adaptive card (the new way), there is a sample available here, along with a detailed guide.

后两种方法的缺点是用户将能够反复单击这些按钮,因此您的漫游器必须在后端处理多个提交.

The downside of the last two approaches is that users will be able to repeatedly click on these buttons so your bot must handle multiple submissions in the backend.