0
BotFramework中的SuggestedActions和Keyboard類有什麼區別?SuggestedActions vs BotFramework中的鍵盤?
我目前正試圖運行一個瀑布,我提出一個問題,用戶選擇一個選項,然後跳到瀑布的下一步。我已經實現了按鈕的建議操作功能
const msg = new builder.Message(session)
.text("Which pair? \nExample: ETH BTC")
.suggestedActions(
builder.SuggestedActions.create(
session, [
builder.CardAction.postBack(session, "BTC USD", "BTC USD"),
builder.CardAction.postBack(session, "ETH USD", "ETH USD"),
builder.CardAction.postBack(session, "ETH BTC", "ETH BTC"),
builder.CardAction.postBack(session, "XRP BTC", "XRP BTC"),
builder.CardAction.postBack(session, "ZEC USD", "ZEC USD")
]
));
session.send(msg);
同樣也是可行的與鍵盤類
const msg = new builder.Message(session)
.text("Which pair? \nExample: ETH BTC")
.addAttachment(new builder.Keyboard(session)
.buttons([
builder.CardAction.postBack(session, "BTC USD", "BTC USD"),
builder.CardAction.postBack(session, "ETH USD", "ETH USD"),
builder.CardAction.postBack(session, "ETH BTC", "ETH BTC"),
builder.CardAction.postBack(session, "XRP BTC", "XRP BTC"),
builder.CardAction.postBack(session, "ZEC USD", "ZEC USD")
]).toAttachment()
)
session.send(msg);
如何捕獲這個按鈕,在接下來的瀑布步反應,或者我應該切換到使用提示來代替。這與鍵盤類有什麼區別