コード例 #1
0
        public async Task StockPrice(IDialogContext context, LuisResult result)
        {
            string strRet = result.Entities[0].Entity;

            //store this stock for the conversation
            context.ConversationData.SetValue <string>("LastStock", strRet);

            await context.PostAsync(await Yahoo.GetStock(strRet));

            context.Wait(MessageReceived);
        }
コード例 #2
0
        public async Task RepeatLastStock(IDialogContext context, LuisResult result)
        {
            string strRet   = string.Empty;
            string strStock = string.Empty;

            if (!context.ConversationData.TryGetValue("LastStock", out strStock))
            {
                strRet = "I don't have a previous stock to look up!";
            }
            else
            {
                strRet = await Yahoo.GetStock(strStock);
            }
            await context.PostAsync(strRet);

            context.Wait(MessageReceived);
        }