コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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();
        }