Copyright (C) 2019 Toranoana Inc. All Rights Reserved.
Alexaがユーザーの発話した単語を受け取れるように
します。
スロットの設定
18
スロットタイプは必須
Copyright (C) 2019 Toranoana Inc. All Rights Reserved.
最も手っ取り早くオウム返しさせるには
Alexa Skills Kitが提供するスロットタイプをスロット
タイプに設定
スロットタイプの設定
19
Copyright (C) 2019 Toranoana Inc. All Rights Reserved.
Alexa Skill Kit が提供するスロットタイプのうち
リストタイプ(AMAZON.CityやAMAZON.Colorなど)
を使用。
本当はカスタムスロットタイプを作成した方がいいです…
(詳細はAlexa Skill Kit - スロットタイプリファレンス
https://developer.amazon.com/ja/docs/custom-
skills/slot-type-reference.html
参照)
スロットタイプの設定
20
Copyright (C) 2019 Toranoana Inc. All Rights Reserved.
const HelloWorldIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'HelloWorldIntent';
},
handle(handlerInput) {
const speechText = 'Hello World!';
return handlerInput.responseBuilder
.speak(speechText)
//.reprompt('add a reprompt if you want to keep the session open for the user to respond')
.getResponse();
}
};
};
ソースの修正
▼ 修正前
21
こ
れ
を
修
正