protected override async Task OnMembersAddedAsync( IList <ChannelAccount> membersAdded, ITurnContext <IConversationUpdateActivity> turnContext, CancellationToken cancellationToken) { foreach (var member in membersAdded) { // Greet anyone that was not the target (recipient) of this message. // To learn more about Adaptive Cards, see https://aka.ms/msbot-adaptivecards for more details. if (member.Id != turnContext.Activity.Recipient.Id) { var welcomeCard = CreateAdaptiveCardAttachment(); var response = MessageFactory.Attachment(welcomeCard, ssml: "Welcome to Bot Framework!"); await turnContext.SendActivityAsync(response, cancellationToken); MediaCardProperties mediaCardProperties = new MediaCardProperties(); mediaCardProperties.CardTitle = "Hello !! We can assist you with following topics?"; Media_Cards media_Cards = new Media_Cards(); List <string> options = new List <string>(); options.Add("Examcards"); options.Add("Coil Combination"); options.Add("Coil Information"); options.Add("T/R Coil queries"); var promptMessage = (Activity)MessageFactory.Attachment(media_Cards.HeroCard(options, mediaCardProperties)); await turnContext.SendActivityAsync(promptMessage, cancellationToken); } } }
private static async Task<DialogTurnResult> DisplayOptionAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { MediaCardProperties mediaCardProperties = new MediaCardProperties(); mediaCardProperties.CardTitle = "Hello !! I can assist you with following queries?"; Media_Cards media_Cards = new Media_Cards(); List<string> options = new List<string>(); options.Add("Examcards"); options.Add("Coil Combination"); options.Add("Coil Information"); options.Add("T/R Coil queries"); var promptMessage = MessageFactory.Attachment(media_Cards.HeroCard(options, mediaCardProperties)); await stepContext.Context.SendActivityAsync(promptMessage, cancellationToken); return await stepContext.EndDialogAsync(); }
private static async Task <DialogTurnResult> RetreiveValueAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { CoilModel coil = CoilData.GetCoilDatails(stepContext.Result.ToString()); if (coil != null) { MediaCardProperties mediaCardProperties = new MediaCardProperties(); mediaCardProperties.CardTitle = coil.CoilName + " (" + coil.CoilType + ")"; mediaCardProperties.CardSubtitle = coil.Applications; mediaCardProperties.CardText = coil.Design; mediaCardProperties.URL = coil.ImagePath; Media_Cards mediaCards = new Media_Cards(); Attachment attachment = mediaCards.ThumbnailCard(mediaCardProperties); await stepContext.Context.SendActivityAsync(MessageFactory.Attachment(attachment)); } else { await stepContext.Context.SendActivityAsync(stepContext.Result.ToString() + " not found!"); } await stepContext.Context.SendActivityAsync("For more information about Coils , Please refer under Coils tab in User Documentation"); var reply = MessageFactory.Text("Do you have other queries "); reply.SuggestedActions = new SuggestedActions() { Actions = new List <CardAction>() { new CardAction() { Title = "Yes", Type = ActionTypes.ImBack, Value = "default" }, new CardAction() { Title = "No", Type = ActionTypes.ImBack, Value = "exit" } }, }; reply.InputHint = InputHints.ExpectingInput; await stepContext.Context.SendActivityAsync(reply, cancellationToken); return(await stepContext.EndDialogAsync(cancellationToken : cancellationToken)); }