Beispiel #1
0
        public async Task Possibilities(IDialogContext context, LuisResult result)
        {
            CreateDialog createCarousel = new CreateDialog();

            Activity replyToConversation = createCarousel.CarouselPossibilitiesNotAllowed(context);

            await context.PostAsync(replyToConversation);

            context.Wait(MessageReceived);
        }
Beispiel #2
0
        public async Task Greetings(IDialogContext context, LuisResult result)
        {
            string    nameUser = context.Activity.From.Name;
            AdaClient client   = new AdaClient()
            {
                WebAppUrl = $"{ ConfigurationManager.AppSettings["WebAppUrl"] }"
            };
            Activity replyToConversation;
            string   message;

            if (nameUser != null)
            {
                string[] firstNameUser = nameUser.Split(' ');
                message = $"{Dialog.Greeting.Spintax()} {firstNameUser[0]}";
            }
            else
            {
                message = $"{Dialog.Greeting.Spintax()}";
            }
            await context.PostAsync(message);

            CreateDialog createCarousel = new CreateDialog();
            var          idUser         = context.Activity.From.Id;
            var          accessAllow    = await client.GetAuthorizationFacebook(idUser);

            if (accessAllow == "true")
            {
                replyToConversation = createCarousel.CarouselPossibilities(context);
            }
            else
            {
                replyToConversation = createCarousel.CarouselPossibilitiesNotAllowed(context);
            }
            await context.PostAsync(replyToConversation);

            context.Done <object>(null);
        }