インテントへの最初の応答が必要な Alexa スキルがあり、遅延後に別の応答を示します。
response.tell(...)
それらの間に複数の呼び出しを使用しようとしましsetTimeout()
たが、これは最初と最後でのみ応答し.tell()
ます。(.tell()
はセッションを終了するように設定されていますが、これを に設定してもfalse
、私のコードはまだ に到達しませんsetTimeout()
)
私がやりたいことについて、いくつかの疑似コードを含めました。
intentHandlers.DynamicDurationIntent = function(intent, session, response) {
var calculatedDuration = doCalculation();
var speechDuration = convertToSpeech(calculatedDuration);
var speechOutput = "Your duration will last <say-as interpret-as="time">' +
speechDuration +
'</say-as>";
response.tell(speechOutput); //I get this far
setTimeout(function () {
var speechOutputEnd = "Great job! You're done.";
response.tell(speechOutputEnd);
}, calculatedDuration);
}
このモデルの例は、7 Minute Workout Alexa Skill で使用されています。
これは AWS Lambda を使用して実現可能ですか?
ありがとう!