microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/samples/CompatBot/Cards.cs
62lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | namespace CompatBot; |
| 5 | |
| 6 | internal class Cards |
| 7 | { |
| 8 | |
| 9 | public static object ResponseCard(string? feedback) => new |
| 10 | { |
| 11 | type = "AdaptiveCard", |
| 12 | version = "1.4", |
| 13 | body = new object[] |
| 14 | { |
| 15 | new |
| 16 | { |
| 17 | type = "TextBlock", |
| 18 | text = "Form Submitted Successfully! ✓", |
| 19 | weight = "Bolder", |
| 20 | size = "Large", |
| 21 | color = "Good" |
| 22 | }, |
| 23 | new |
| 24 | { |
| 25 | type = "TextBlock", |
| 26 | text = $"You entered: **{feedback ?? "(empty)"}**", |
| 27 | wrap = true |
| 28 | } |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | public static readonly object FeedbackCardObj = new |
| 33 | { |
| 34 | type = "AdaptiveCard", |
| 35 | version = "1.4", |
| 36 | body = new object[] |
| 37 | { |
| 38 | new |
| 39 | { |
| 40 | type = "TextBlock", |
| 41 | text = "Please provide your feedback:", |
| 42 | weight = "Bolder", |
| 43 | size = "Medium" |
| 44 | }, |
| 45 | new |
| 46 | { |
| 47 | type = "Input.Text", |
| 48 | id = "feedback", |
| 49 | placeholder = "Enter your feedback here", |
| 50 | isMultiline = true |
| 51 | } |
| 52 | }, |
| 53 | actions = new object[] |
| 54 | { |
| 55 | new |
| 56 | { |
| 57 | type = "Action.Execute", |
| 58 | title = "Submit Feedback" |
| 59 | } |
| 60 | } |
| 61 | }; |
| 62 | } |
| 63 | |