我已經嘗試了ImBack作爲值字段中的動作類型,我正在獲取文本。當我點擊英雄卡時,我已經寫在代碼中的值在點擊現在後顯示,問題是文本應該作爲方法中的值傳遞,以便在單擊該方法後調用該方法。請提供解決方案。CardAction中的英雄卡在傳送帶卡中不能作爲可操作的按鈕
public static IList<Attachment> GetCardsAttachments(IDialogContext context)
{
return new List<Attachment>()
{
GetHeroCard(
"NoSQL",
"Blazing fast, planet-scale NoSQL",
"NoSQL service for highly available, globally distributed apps—take full advantage of SQL and JavaScript over document and key-value data without the hassles of on-premises or virtual machine-based cloud database options.",
new CardImage(url: "https://docs.microsoft.com/en-us/bot-framework/media/how-it-works/architecture-resize.png"),
new CardAction(ActionTypes.ImBack, "Click here", value: "see the below options:")),
};
}
預期行爲
從上面的代碼,我得到與按鈕名稱牌爲「點擊這裏」點擊它在我輸入給機器人作爲「看到下面的選項:」之後,後這我想發起一個功能。 我希望將值傳遞給函數。所以我可以進一步處理。 請告訴我如何使用CardAction的這個值。
哪裏碼? – Ben
歡迎來到Stackoverflow!請提供[mcve]你試過的東西。 –
公共靜態的IList GetCardsAttachments(IDialogContext上下文) { 回報新名單() { GetHeroCard( 「的NoSQL」, 「速度極快,地球規模的NoSQL」, 「NoSQL的服務高度可用,分佈在全球各地應用程序 - 充分利用基於SQL的雲數據庫選項。「, new CardImage(url:」https://docs.microsoft.com/en-us/bot-framework/media/how-it-works/architecture-resize ), 新的CardAction(ActionTypes.ImBack,「Click here」,value:「請參閱下面的選項:」)), }; } –