Ejemplo n.º 1
0
        private async Task MessageReceivedAsync(IDialogContext context, IAwaitable <object> result)
        {
            var activity = await result as Activity;

            // temp logic
            var textToReturn = string.Empty;
            var textToSearch = activity.Text.ToLower();

            if (textToSearch.Contains("should i eat"))
            {
                var decision = ApiCaller.GetBoolDecision();
                if (decision == true)
                {
                    textToReturn = "Yes!";
                }
                else
                {
                    textToReturn = "No.";
                }
            }
            else if (textToSearch.Contains("points"))
            {
                textToReturn = ApiCaller.GetNumericPoints().ToString();
            }
            else if (textToSearch.Contains("max"))
            {
                textToReturn = ApiCaller.GetMaxPoints().ToString();
            }

            // return our reply to the user
            await context.PostAsync(textToReturn);

            context.Wait(MessageReceivedAsync);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Console.WriteLine(ApiCaller.GetNumericPoints().ToString());
            Console.WriteLine(ApiCaller.GetBoolDecision().ToString());


            Console.ReadKey();
        }