public override SpeechletResponse OnIntent(IntentRequest request, Session session) { logger.Log($"OnIntent called for session {session.SessionId}"); try { var intent = request.Intent; var intentName = intent?.Name; logger.Log($"Intent name: {intentName}"); if ("ChordIntent".Equals(intentName)) { var chordFinder = new ChordFinder(); var chordProcessor = new ChordProcessor(logger, chordFinder); return(chordProcessor.ProcessChord(intent.Slots["chord"]?.Value)); } if ("AMAZON.CancelIntent".Equals(intentName) || "AMAZON.StopIntent".Equals(intentName)) { return(SsmlResponseFactory.Create("<say-as interpret-as='interjection'>okey dokey.</say-as>", true)); } } catch (Exception e) { logger.Log($"About to fail with error {e}"); throw; } logger.Log("About to fail"); throw new SpeechletException("Invalid Intent"); }
public ChordProcessor(Logger logger, ChordFinder chordFinder) { this.logger = logger; this.chordFinder = chordFinder; }