This commit is contained in:
ろむねこ 2024-07-16 11:28:12 +09:00
parent 8ebeb1d0d0
commit 87317a33e1
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -44,7 +44,8 @@ const HelloWorldIntentHandler = {
const KidShiftAuthIntentHandler = {
canHandle(handlerInput: Alexa.HandlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === ("KidShiftAuthIntent" || "IntentRequest")
return (Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest')
|| (Alexa.getRequestType(handlerInput.requestEnvelope) === 'KidShiftAuthIntent');
},
handle(handlerInput: Alexa.HandlerInput) {
@ -59,7 +60,13 @@ const KidShiftAuthIntentHandler = {
}
// LOGIN_CODEスロットの値を取得
const loginCode = Alexa.getSlotValue(handlerInput.requestEnvelope, "LOGIN_CODE");
const loginCode = Alexa.getSlotValue(handlerInput.requestEnvelope, "loginCode");
if (!loginCode) {
return handlerInput.responseBuilder
.addElicitSlotDirective("loginCode")
.getResponse();
}
const speakOutput = "Slot value is " + loginCode;