public static void GoogleSetCard(this ITurnContext context, string title, string subtitle, Image image, ImageDisplayOptions imageDisplayOptions, string formattedText) { if (image == null && formattedText == null) { throw new Exception("A Basic Card should have either an Image or Formatted Text set"); } var card = new GoogleBasicCard() { Content = new GoogleBasicCardContent() { Title = "This is the card title", Subtitle = "This is the card subtitle", FormattedText = "This is some text to go into the card." + "**This text should be bold** and " + "*this text should be italic*.", Display = ImageDisplayOptions.DEFAULT, Image = new Image() { AccessibilityText = "This is the accessibility text", Url = "https://dev.botframework.com/Client/Images/ChatBot-BotFramework.png" }, }, }; context.TurnState.Add("GoogleCard", card); }
public static void GoogleSetCard(this ITurnContext context, string title, string subtitle, Image image, ImageDisplayOptions imageDisplayOptions, string formattedText) { if (image == null && formattedText == null) { throw new Exception("A Basic Card should have either an Image or Formatted Text set"); } // Fixed var card = new GoogleBasicCard() { Content = new GoogleBasicCardContent() { Title = title, Subtitle = subtitle, FormattedText = formattedText, Display = ImageDisplayOptions.DEFAULT, Image = image }, }; // Just leaving this as commented to give developers a glimpse of implementation. //var card = new GoogleBasicCard() //{ // Content = new GoogleBasicCardContent() // { // Title = "This is the card title", // Subtitle = "This is the card subtitle", // FormattedText = "This is some text to go into the card." + // "**This text should be bold** and " + // "*this text should be italic*.", // Display = ImageDisplayOptions.DEFAULT, // Image = new Image() // { // AccessibilityText = "This is the accessibility text", // Url = "https://dev.botframework.com/Client/Images/ChatBot-BotFramework.png" // }, // }, //}; context.TurnState.Add("GoogleCard", card); }
public static void GoogleSetCard(this ITurnContext context, GoogleBasicCard card) { context.TurnState.Add("GoogleCard", card); }