public override SpeechletResponse OnLaunch(LaunchRequest request, Session session) { string SkillName = _informationSkillSerive.GetSkillName(session.Application.Id); string speechOutput; bool shouldSessionEnd = false; try { speechOutput = _informationSkillSerive.GetWelcomeMessage(session.Application.Id); if (String.IsNullOrWhiteSpace(speechOutput)) { IntentMessageModel intentMessageModel = _informationSkillSerive.GetAnyIntentMessage(session.Application.Id, session.User.Id); if (intentMessageModel != null) { speechOutput = intentMessageModel.Mesasge; shouldSessionEnd = intentMessageModel.ShouldEndSession; } } } catch (Exception e) { speechOutput = e.Message; } if (speechOutput == null) { speechOutput = "Willkommen"; } return(BuildSpeechletResponse(SkillName, speechOutput, shouldSessionEnd, request, null, session)); }
public override SpeechletResponse OnIntent(IntentRequest request, Session session) { string SkillName = _informationSkillSerive.GetSkillName(session.Application.Id); Intent intent = request.Intent; string intentName = (intent != null) ? intent.Name : null; IntentMessageModel speechOutput = _informationSkillSerive.GetIntentMessage(session.Application.Id, intentName, session.User.Id); if (speechOutput == null || String.IsNullOrWhiteSpace(speechOutput.Mesasge)) { return(BuildSpeechletResponse(intent.Name, "", true, null, request, session)); } return(BuildSpeechletResponse(SkillName, speechOutput.Mesasge, speechOutput.ShouldEndSession, null, request, session)); }