This commit is contained in:
ろむねこ 2024-07-16 12:47:44 +09:00
parent 236b1bdbad
commit 7cdeb681b6
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -44,34 +44,15 @@ const HelloWorldIntentHandler = {
const KidShiftAuthIntentHandler = {
canHandle(handlerInput: Alexa.HandlerInput) {
// return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
// && Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftAuthIntent';
return Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftAuthIntent';
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftAuthIntent';
},
handle(handlerInput: Alexa.HandlerInput) {
// if (!Alexa.getSlotValue(handlerInput.requestEnvelope, 'loginCode')) {
// return handlerInput.responseBuilder
// .speak("Login code is not provided")
// .getResponse();
// }
//
// const loginCode = Alexa.getSlotValue(handlerInput.requestEnvelope, 'loginCode');
//
// if (!loginCode) {
// return handlerInput.responseBuilder
// .speak("Login code is not provided")
// .getResponse();
// }
//
// const speakOutput = "Slot value is " + loginCode;
//
// return handlerInput.responseBuilder
// .speak(speakOutput)
// .getResponse();
const loginCode = Alexa.getSlot(handlerInput.requestEnvelope, 'loginCode');
const speakOutput = `You entered the code ${loginCode.value}.`;
return handlerInput.responseBuilder
.speak("Deployed successfully!")
.speak(speakOutput)
.withShouldEndSession(true)
.getResponse();
}
};