Пример #1
0
        private bool ReaderSaidTheWord(Alexa.NET.Request.Type.IntentRequest input)
        {
            if (input.Intent.Slots?.Any() ?? false)
            {
                foreach (ResolutionAuthority auth in input.Intent.Slots.Last().Value.Resolution.Authorities)
                {
                    if (auth.Status.Code == ResolutionStatusCode.SuccessfulMatch)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
        public static SkillResponse CanFulfillAll(Request.Type.IntentRequest intentRequest)
        {
            SkillResponse response = new SkillResponse {
                Version = "1.0"
            };

            response.Response = new ResponseBody
            {
                CanFulfillIntent = new CanFulfillIntentResponse
                {
                    CanFulfill = CanFulfill.YES,
                    Slots      = intentRequest.Intent.Slots.ToDictionary(s => s.Key, s => new CanFulfillSlot {
                        CanFulfill = CanFulfill.YES, CanUnderstand = CanFulfill.YES
                    }),
                }
            };


            return(response);
        }