Guest User

Untitled

a guest
Feb 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. AddStep(async (stepContext, cancellationToken) =>
  2. {
  3. var reply = stepContext.Context.Activity.CreateReply();
  4. reply.Attachments = new List<Attachment>();
  5. reply.Attachments.Add(GetVideoCard().ToAttachment());
  6. await stepContext.Context.SendActivityAsync(reply, cancellationToken);
  7. return await stepContext.NextAsync();
  8. });
  9.  
  10. ////////////////
  11.  
  12. private static VideoCard GetVideoCard()
  13. {
  14. var videoCard = new VideoCard
  15. {
  16. Title = "Budgeting Introduction",
  17. Subtitle = "by Finko",
  18.  
  19. Media = new List<MediaUrl>
  20. {
  21. new MediaUrl()
  22. {
  23. Url = "https://www.youtube.com/watch?v=XLo1geVokhA",
  24. },
  25. },
  26. Buttons = new List<CardAction>
  27. {
  28. new CardAction()
  29. {
  30. Title = "Learn More at Finko.PH",
  31. Type = ActionTypes.OpenUrl,
  32. Value = "https://m-moreno.wixsite.com/finkoph?fbclid=IwAR1NVtlyKfzZ0mYFIWva8L-d8TUv4KFpt_m1i1ij3raT-pbWr2c3-kqzB2Q",
  33. },
  34. },
  35. };
  36.  
  37. return videoCard;
  38. }
  39.  
  40. AddStep(async (stepContext, cancellationToken) =>
  41. {
  42. var activity = stepContext.Context.Activity;
  43. await stepContext.Context.SendActivityAsync(CreateResponse(activity, CreateVideoCardAttacment()));
  44. return await stepContext.NextAsync();
  45. });
  46.  
  47. ////////////////////////
  48.  
  49. private Activity CreateResponse(Activity activity, Attachment attachment)
  50. {
  51. var response = activity.CreateReply();
  52. response.Attachments = new List<Attachment>() { attachment };
  53. return response;
  54. }
  55.  
  56. private Attachment CreateVideoCardAttacment()
  57. {
  58. return new VideoCard()
  59. {
  60. Title = "Are you a Seafarer? OFW? FREE PERSONAL FINANCIAL ADVICE HERE!!",
  61. Media = new List<MediaUrl>()
  62. {
  63. new MediaUrl("https://www.youtube.com/watch?v=XLo1geVokhA")
  64. },
  65. Buttons = new List<CardAction>()
  66. {
  67. new CardAction()
  68. {
  69. Type = ActionTypes.OpenUrl,
  70. Title = "Learn More at Finko.PH",
  71. Value = "https://m-moreno.wixsite.com/finkoph?fbclid=IwAR1NVtlyKfzZ0mYFIWva8L-d8TUv4KFpt_m1i1ij3raT-pbWr2c3-kqzB2Q"
  72. }
  73. },
  74. Subtitle = "by Finko.Ph",
  75. Text = "Are you tired of getting bogus financial advice? Tired of having 'kape' just to find out it was networking, or a pyramid scheme? Tired of scouring the internet for HOURS but not finding what you're looking for? We're here to help! We give financial advice and will educate you on financial literacy topics, ABSOLUTELY FREE!!"
  76. }.ToAttachment();
  77. }
Add Comment
Please, Sign In to add comment