async handle()

in lambda/src/index.ts [58:86]


    async handle(handlerInput) {
        const dialogState = Alexa.getDialogState(handlerInput.requestEnvelope)

        if (dialogState !== 'COMPLETED') {
            // ダイアログモデルのスロット質問中の場合
            return handlerInput.responseBuilder
                .addDelegateDirective()
                .getResponse();
        } else {
            if(Alexa.getSlot(handlerInput.requestEnvelope, "ScheduleType").resolutions.resolutionsPerAuthority[0].values[0].value.id === "ALL_DAY"){
                // 予約確認Alexa応答に対して「はい」発話時
                return handlerInput.responseBuilder
                    .speak("期間予定を登録します。予定の詳細を教えてください")
                    .addDelegateDirective({
                        name: "RegisterAllDayScheduleIntent",
                        confirmationStatus: "NONE"
                    })
                    .getResponse();
            }
            // 予約確認Alexa応答に対して「はい」発話時
            return handlerInput.responseBuilder
                .speak("通常予定を登録します。予定の詳細を教えてください")
                .addDelegateDirective({
                    name: "RegisterRegularScheduleIntent",
                    confirmationStatus: "NONE"
                })
                .getResponse();
        }
    }