public static IAliceResponse Ask(UserRequest request)
        {
            RoomBookingExtension.AliceRequestHandler handler = new RoomBookingExtension.AliceRequestHandler();
            AliceContext.Current.Register(handler);
            AliceContext.Current.UserProfile.UserName     = "******";
            AliceContext.Current.UserProfile.TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");

            Alice.Framework.Alice bot      = new Alice.Framework.Alice();
            IAliceResponse        response = bot.Ask(request);

            return(response);
        }
Exemple #2
0
        private IAliceResponse ProcessMessage(string userMessage)
        {
            userMessage = CleanupRequestMessage(userMessage);

            CommandFinder finder = new CommandFinder();
            Tuple <Command, IAliceRequestHandler> tuple;

            tuple = finder.FindOrDefault(userMessage);

            Command command = tuple.Item1;
            IAliceRequestHandler handler   = tuple.Item2;
            CommandProcessor     processor = new CommandProcessor(handler, command, userMessage);
            IAliceResponse       response  = processor.Process();

            return(response);
        }