Ejemplo n.º 1
0
        private IMessageActivity GetInstructionsCard(IDialogContext context)
        {
            var message = context.MakeMessage();

            message.Attachments.Add(ResponseCards.GenerateInstructionsCard());
            return(message);
        }
Ejemplo n.º 2
0
        public async Task Philips(IDialogContext context, string messageText)
        {
            var message = context.MakeMessage();

            message.Attachments.Add(ResponseCards.GenerateWorkCard(PhilipsHealthcare_Option));
            await context.PostAsync(message);

            context.Done(true);
        }
Ejemplo n.º 3
0
        public async Task Education(IDialogContext context, LuisResult result)
        {
            var message = context.MakeMessage();

            message.Attachments.Add(ResponseCards.GenerateEducationCard());
            await context.PostAsync(message);

            context.Wait(MessageReceived);
        }
Ejemplo n.º 4
0
        public async Task GeneralMenu(IDialogContext context, LuisResult result)
        {
            var message = context.MakeMessage();

            message.Attachments.Add(ResponseCards.GenerateMenuCard("GENERAL", Responses.menuOptions));
            await context.PostAsync(message);

            context.Wait(MessageReceived);
        }
Ejemplo n.º 5
0
        public async Task WorkExperience(IDialogContext context, LuisResult result)
        {
            var message = context.MakeMessage();

            message.Attachments.Add(ResponseCards.GenerateMenuCard("JOBS", Responses.workOptions));
            await context.PostAsync(message);

            context.Wait(MessageReceived);
        }
Ejemplo n.º 6
0
        public async Task Projects(IDialogContext context, LuisResult result)
        {
            var message = context.MakeMessage();

            message.Attachments.Add(ResponseCards.GenerateMenuCard("PROJECTS", Responses.projectsOptions));
            await context.PostAsync(message);

            context.Wait(MessageReceived);
        }
Ejemplo n.º 7
0
        public async Task Biomedical(IDialogContext context, string messageText)
        {
            var message = context.MakeMessage();

            message.AttachmentLayout = AttachmentLayoutTypes.Carousel;
            message.Attachments      = ResponseCards.GenerateBiomedicalProjectsCard();
            await context.PostAsync(message);

            context.Done(true);
        }
Ejemplo n.º 8
0
 private async Task HandleSystemMessage(Activity message)
 {
     if (message.Type == ActivityTypes.DeleteUserData)
     {
         // Implement user deletion here
         // If we handle user deletion, return a real message
     }
     else if (message.Type == ActivityTypes.ConversationUpdate)
     {
         // Handle conversation state changes, like members being added and removed
         // Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info
         // Not available in all channels
         IConversationUpdateActivity update = message;
         var client = new ConnectorClient(new Uri(message.ServiceUrl), new MicrosoftAppCredentials());
         if (update.MembersAdded != null && update.MembersAdded.Any())
         {
             foreach (var newMember in update.MembersAdded)
             {
                 var reply = message.CreateReply();
                 if (newMember.Id != message.Recipient.Id)
                 {
                     reply.Text = $"Welcome {newMember.Name}!";
                 }
                 else
                 {
                     reply.Attachments.Add(ResponseCards.GenerateInstructionsCard());
                 }
                 await client.Conversations.ReplyToActivityAsync(reply);
             }
         }
         String replyMessage = string.Empty;
     }
     else if (message.Type == ActivityTypes.ContactRelationUpdate)
     {
         // Handle add/remove from contact lists
         // Activity.From + Activity.Action represent what happened
     }
     else if (message.Type == ActivityTypes.Typing)
     {
         // Handle knowing tha the user is typing
     }
     else if (message.Type == ActivityTypes.Ping)
     {
     }
 }